Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.
Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to
a specific version, you will need to compile it yourself. Then asdf
is your best friend.
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install wxmac
brew cask install java
brew install fop
asdf
lives in https://github.com/asdf-vm/asdf
Follow its installation instructions, which at the moment of writing were:
brew install asdf
echo -e '\n. /usr/local/Cellar/asdf/0.7.0/asdf.sh' >> ~/.bashrc
*Note that the above assumes you have version 0.7.0 installed. Please check for the proper directory by using:
brew info asdf
On a new terminal, install Erlang and Elixir plugins:
asdf plugin-add erlang
asdf plugin-add elixir
asdf install erlang 21.2.6
asdf install elixir 1.8.1-otp-21
Then set them as the global version:
asdf global erlang 21.2.6
asdf global elixir 1.8.1-otp-21
Now you can open a new terminal and try erl
:
$ erl
Erlang/OTP 21 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V9.3 (abort with ^G)
1>
Or start Erlang Observer by erl -s observer start
.
And you can try 'iex':
$ iex
Erlang/OTP 21 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.8.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
Use asdf
.tool-versions
file to manage which version is active on each of your projects.
Enjoy!