2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7にphoenix環境を入れる

Last updated at Posted at 2016-05-05

参考:http://qiita.com/yokaigundan/items/0e8da4938bd91fab400b

この記事の目標

  • erlangのインストールから始めて、phoenixで何か動かすところまで。
  • yumだとElixirが上手く入らないのでyum以外で。
  • Erlangはver.18を使う

Erlang(evm)インストール

参考にした記事 + ncurses-devel で十分のよう。

sudo yum install -y lynx wget curl git nodejs npm redhat-lsb inotify-tools ncurses-devel
git clone https://github.com/robisonsantos/evm.git
cd evm
./install

echo 'source /home/$USER/.evm/scripts/evm' >> ~/.bashrc
source ~/.bashrc

evm list
evm install OTP_18.3
# この記事の時点での最新版
evm default OTP_18.3

cd ../

erl

Elixir(kiex)

IEx (Interactive Elixir)

\curl -sSL https://raw.githubusercontent.com/taylor/kiex/master/install | bash -s
echo 'test -s "$HOME/.kiex/scripts/kiex" && source "$HOME/.kiex/scripts/kiex"' >> ~/.bashrc
source ~/.bashrc
kiex list known
kiex install 1.2.5
kiex use 1.2.5

iex

rebar

makeみたいなツール。

git clone git://github.com/rebar/rebar.git
cd rebar
./bootstrap
sudo mv rebar /usr/local/bin/
rebar -V

cd ../

phoenix

mix local.hex
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

phoenixで何か作ってみる

mix phoenix.new hello_phoenix

npmを更新しておく

sudo npm install -g npm
mix deps.get
npm install

nodeのバージョン更新しておく

参考:http://parashuto.com/rriver/tools/updating-node-js-and-npm

sudo npm install -g n
sudo n --stable
sudo n latest

走らせてみる

cd hello_phoenix
mix phoenix.server

アクセスしてみる

別ターミナルでcurl

curl localhost:4000
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?