Elixirも1.0.5がリリースされたことで、 rbenv のようなバージョンコントロールないかなーと探してみたら、kiexがありました。
https://github.com/taylor/kiex
使い方は簡単。
- 以下コマンドを実行する
curl -sSL https://raw.githubusercontent.com/taylor/kiex/master/install | bash -s
- bash_profileなどに以下を追記する。
test -s "$HOME/.kiex/scripts/kiex" && source "$HOME/.kiex/scripts/kiex"
kiexコマンドを実施する
$ kiex
kiex commands:
list - shows currently installed Elixirs
list known - shows available Elixir releases
list branches - shows available Elixir branches
install <version> - installs the given release version
use <version> [--default] - uses the given version for this shell
shell <version> - uses the given version for this shell
default <version> - sets the default version to be used
selfupdate - updates kiex itself
implode - removes kiex and all installed Elixirs
reset - resets default Elixir version to null
この時点では、1.0.5が最新なので、 $ kiex install 1.0.5を実施しました。
あとは、 use や default で指定してあげれば良いですね。
~/.kiex/ 配下に、gitやビルドした結果が格納されて、 use などのコマンドで切り替えて複数バージョンを使い分ける、ということになります。
なるほど。