LoginSignup
14
8

More than 3 years have passed since last update.

elixir を asdf で環境構築する手順

Last updated at Posted at 2019-11-02

Homebrew Install

Mac OSX

Homebrewのインストール
1. macOSでHomebrew パッケージマネージャーをインストール

HomebrewのHP > https://brew.sh/index_ja

ターミナルに下記のコマンドをコピーしてペースト

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

asdf Install

brew install asdf

Homebrewによるインストール

echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ~/.bash_profile
echo -e "\n. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash" >> ~/.bash_profile

ターミナルを再起動します。

プラグインの依存関係

brew install \
  coreutils automake autoconf openssl \
  libyaml readline libxslt libtool unixodbc \
  unzip curl

asdfの概要と流れ

  1. プラグインのインストール asdfで管理したい言語のプラグインをインストールします。 asdfで管理する為の言語が入ってる場合は asdf plugin-list で確認できます。

プラグインをインストール後に、プラグインのリストにある言語の
バージョンを指定してインストールします。

  1. 言語のバージョンをインストール インストールしたいバージョンを確認する為に
 asdf list-all プラグインに入っている言語名

バージョンを選んでインストール

asdf install プラグインに入っている言語名 バージョン番号
  1. インストールしたバージョンを有効にする

ターミナルのディレクトリ配下でのみ、そのバージョンを有効にしたい場合

asdf local プラグインに入っている言語名 バージョン番号

どこからでも使えるようにしたい場合

asdf global プラグインに入っている言語名 バージョン番号

elixirの環境構築の流れ

  • asdfでerlangのプラグインをインストールします。
 asdf plugin-add erlang
  • asdfでelixirのプラグインをインストールします。
 asdf plugin-add elixir
  • asdf plugin-list で確認する
asdf plugin-list
erlang
elixir
  • バージョンを確認する
asdf list-all erlang
asdf list-all elixir
  • インストールする
asdf install erlang 21.1.0
asdf install elixir 1.7.4
  • 使えるようにする
asdf global erlang 21.1.0
asdf global elixir 1.7.4
  • 確認する
asdf current
14
8
1

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
14
8