Erlang, Elixir & Phoenix Framework on Linux Mint

Taking a bit of time off from working on my current pet project CodeHalf tonight I decided to use my half an hour for something else.

Finally get started with another thing I've been meaning to get on with for months: Try out the Phoenix Framework

Getting everything up and running wasn't entirely straight forward on Mint so I thought I'd pop the steps I took here for future reference.

Install Erglang 17 or newer

To see if you have a version of erlang installed run:

$ erl

If you have erlang you'll get something like this back

Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]  

18 here is the version number. As far as I know Mint doesn't currently come with a preinstalled Erlang so it's up to you to install it.

Easiest way to resolve all the dependencies and to get to the latest version with least amount of copy pasta from the internet I found was to install the erlang package using apt and then build the latest version from source.

$ sudo apt-get install erlang

At the time of writing this installs version 16.

Head on over to the Erlang Downloads page and get the latest source

$ wget http://www.erlang.org/download/otp_src_18.1.tar.gz
$ tar -xvf otp_src_18.1.tar.gz
$ cd otp_src_18.1.tar.gz
$ ./configure
$ make
$ sudo make install

After this you should have an up to date version of Erlang!

Install Elixir

To check for existing elixir installation and version you can run:

$ elixir -v 

If you need to get the latest precompiled release from the Elixir Releases page

$ wget https://github.com/elixir-lang/elixir/releases/download/v1.1.1/Precompiled.zip
$ unzip Precompiled.zip -d elixir

Finally add the bin folder from the new elixir folder to your PATH.

You should now be able to run

$ elixir -v

Again and see the latest version.

Install Hex package manager

Hex package manager is used to install Phoenix so if we have a fresh install we can install it by running:

mix local.hex  

Install Phoenix

Head on over to the Phoenix Releases page in Github and grab the latest .ez archive and install it using Hex

$ wget https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez
$ mix archive.install phoenix_new-1.0.3.ez

That's it we're all setup