LoginSignup
1
0

More than 5 years have passed since last update.

Elixir のインストールのやり方

Last updated at Posted at 2018-10-07

インストールの前に

インストール前に以下の事を確認しておいてください

  • OSが最新かどうか確認する
    (2018年10月6日現在macOSのバージョンは10.13.6)

  • Homebrewをインストールする
    (HomebrewはMac OS Xオペレーティングシステム上でソフトウェアの導入を単純化するパッケージ管理システムのひとつらしいです)

インストール方法は以下の画像の通りです
画像下にスクリプトを書いておきます
スクリーンショット 2018-10-07 23.29.16.png
[/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"]

Elixir のインストール

このサイトにわかりやすく書かれています
https://qiita.com/keitaMatsuo/items/33f1ecb74383374248d8
ただし記事が古く今ではバージョンなどが変わっているため、最新のやり方をここで紹介します
このサイトの3番を参照します

ターミナルに以下を1文1文入力してください
スムーズにいくと15分ほどでインストールが完了します

brew update
brew install openssl
export PATH=/usr/local/opt/openssl/bin:$PATH
source ~/.bash_profile
$ cd
$ git clone http://erlang.org/download/otp_src_21.1.readme
echo 'export PATH="$HOME/.erlenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(erlenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
curl -O http://erlang.org/download/otp_src_21.1.tar.gz
tar zxf otp_src_21.1.tar.gz
cd otp_src_21.1

上の部分でダンロードしたバージョンと同じ事を確認してください
違うバージョンを入力しているとエラーになります

./configure --prefix=/Users/◯◯◯◯(Macの名前)/.erlenv/releases/21.1 --enable-smp-support --enable-threads --enable-darwin-64bit --enable-kernel-poll --enable-hipe --without-javac --enable-dirty-schedulers --enable-sharing-preserving --enable-lock-counter --disable-sctp --with-ssl=/usr/local/opt/openssl --without-obdc 
touch lib/wx/SKIP lib/odbc/SKIP
make
sudo make install
erlenv global 21.1
erlenv rehash
erl
brew install elixir-build
brew install exenv
echo 'export PATH="$HOME/.exenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(exenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
exenv install -l
exenv install 1.7.3
exenv global 1.7.3

ここでもバージョンを確認してください

これでElixirのインストールが完了します
最後のコマンド

elixir -v

これを実行しターミナルに以下の文章が表示されたら正常にインストールされています

Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [sharing-preserving]

Elixir 1.7.3 (compiled with Erlang/OTP 21)
1
0
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
1
0