Having a little bit of free time tonight, I thought I’d look into Elixir and Phoenix. Elixir is a relatively new language that runs on the Erlang VM and Phoenix is the web framework for it. There has been a lot of talk on Hacker News about in the past couple of years. famously runs Erlang in its backend and it was a key factor for it scaling so well. This was the main reason I’ve been interested in it for a while. Elixir WhatsApp A while back, I saw the blog series by Kevin Peter and learned more about Elixir. I recommend the series — I’ve only gone through the first few chapters and it already gives me a very good background on Elixir. Learn With Me: Elixir So I thought I’d install Elixir to try things out a bit. Elixir Installation — with version managers So my goal is to install Elixir (and Erlang VM). I’ve been working with nodejs for the past couple of years and I really like the way handles installing and version-switching of node in your environment. Coming from the PHP world prior to that, this is a huge improvement, as PHP is installed at the system level and is difficult to adjust. nvm Because of this, I steered away from the default instruction of installing with the OS’s package manager ( / / / /etc.), and looked for something similar to . brew pacman yum apt-get nvm mentions a few version managers. After reading over their READMEs I decided to go with and . is an Erlang version manager and is built to be similar to kerl. Both are fairly similar to in concept and usage, which is something I want. Elixir’s install page kerl kiex kerl kiex nvm In an effort to stay away from the system’s package manager, I install by simply downloading it and moving it to a directory in my home: kerl curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerlchmod a+x kerlmkdir ~/.kerlmv kerl ~/.kerl Then I edit my file to add this line: .bashrc export PATH=$HOME/.kerl:$PATH Now is available on my bash. kerl Next, installing is also easy, and is similar to how you run a script from their repo: kiex nvm curl -sSL | bash -s https://raw.githubusercontent.com/taylor/kiex/master/install Now both and are ready! kerl kiex Installing a version of Erlang VM and Elixir The thing to note about installing the Erlang VM is you have to build it. If you run and then simply run you’ll run into an error saying it’s not built. So you’ll want to run: kerl list releases kerl install 21.2 kerl build 21.2 This will begin a download of the Erlang source and compile it. It will take a while. (On my laptop it took 25 minutes. The download was 80+mb and took a few minutes, and the rest was the compile.) The lack of a progress bar can be concerning during compile, so if you’re wondering if it’s doing anything at all, you can tail the build log in a separate terminal to see what it’s doing: tail -f ~/.kerl/builds/21.2/otp_build_21.2.log The nice thing about our setup now is that since we placed the script in , the location it’s built is automatically within the directory, similar to how operates. kerl ~/.kerl nvm After build completes, we can do a kerl install: kerl install 21.2 ~/.kerl/installs/21.2 Once installed, you’ll have to activate it: . ~/.kerl/installs/21.2/activate Both of the last two steps should be really fast. Note: Use to deactivate the installation at any time. Use to verify the activated installation at any time. kerl_deactivate kerl active Now we’re ready to install Elixir with . We can use to see list of versions, and install the latest like follow: kiex kiex list known kiex install 1.8.1 Now a specific Elixir version is installed in your current environment. Finally, to switch to it to use it: kiex use 1.8.1 And that’s it! Commands such as , and should now be available on your terminal. elixir iex mix Phoenix — the fastest, least dependencies way to get a server running (to get a feel for it) Phoenix framework is really full-featured, so naturally it comes with things like working with Postgres by default and wants you set up a database etc. to get going. If you want the quickest way possible to get a Phoenix server up and running to get a feel for it, you can first install Phoenix: # install hex, the package manager of elixirmix local.hex # install phoenixmix archive.install hex phx_new 1.4.0 Then create a new Phoenix project with minimal dependencies: mix phx.new --no-ecto --no-html ~/phoenixtest Finally, simply and start the server with: cd ~/phoenixtest mix phx.server And your server will be up and running on localhost:4000! P.S. the route for will return an error :) GET /