Elixir Environment

Welcome to a tutorial on Elixir. Here you will learn how to run Elixir by setting it up locally on your computer.

To have Elixir running on your computer, you need to install Elixir but you need to have Erlang first. However, on some platforms, Elixir packages come with Erlang. In the next session, we will the steps to install Elixir on our local computer.

 

Installing Elixir

Here, we will consider different operating systems.

 

Windows Setup

Firstly, download the installer from https://repo.hex.pm/elixirwebsetup.exe and click next to proceed through all steps. If success, it means you now have Elixir on your local computer.

 

Mac Setup

Here, before proceeding with the installation, note that if you have Homebrew installed, ensure it is the latest version. But you can update by using the command below:

brew update

You can now install Elixir using the command below:

brew install elixir

 

Ubuntu/Debian Setup

Follow the steps below to install Elixir in your Ubuntu/Debian operating system:

Step 1: Add Erlang Solutions repo as shown below:

wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb 
sudo apt-get update 

Step 2: Install the Erlang/OTP platform and all of its applications, as shown below:

sudo apt-get install esl-erlang

Step 3: Now, install Elixir.

sudo apt-get install elixir

 

Testing the Setup

After installing, you can test the Elixir setup on your system, by opening your terminal and entering the command iex in it. After which the interactive elixir shell will open, as shown below.

Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] 
[smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]  

Interactive Elixir (1.3.1) - press Ctrl+C to exit (type h() ENTER for help) 
iex(1)>

Congratulations! You have successfully set up Elixir on your system.