1. Setup Elixir

Before you can start learning Elixir, you will need to get your development environment configured correctly, by intsalling Elixir.[1]

1.1. Installation

1.1.1. MacOS

For MacOS, the recommended way to install is via [homebrew].

Most application in homebrew, Elixir included, need Xcode to properly install. Ensure that you have Xcode installed by running the following command.

xcode-select --install

You can determine if homebrew is already installed by running brew -v in your terminal. If it is not, you can install it by running the script below to install it.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

With brew available, you can then install Elixir:

brew install elixir

1.1.2. Windows

You can install Elixir via the official web installer. However, all of this book assumes you are running a Unix-style shell. I suggest to instead setup WSL and run Elixir in that, instead.

1.1.3. Linux

Most package distributions should have an elixir package available to install. Below are installation commands for some common distributions. You can also check out the official instructions if your distribution is not covered below.

  • Fedora: dnf install elixir

  • Ubuntu: apt-get install elixir

  • Arch: pacman -S elixir