Elixir (programming language)/Installation Guide

From Elixir Wiki
Jump to navigation Jump to search

Installation Guide[edit]

Option 1: Installing Elixir on macOS[edit]

  1. Download the Homebrew package manager by executing the command:
<code>brew install</code>
  1. Install Elixir by executing the following command:
<code>brew install elixir</code>

Option 2: Installing Elixir on Ubuntu[edit]

  1. Update the package list by running this command:
<code>sudo apt-get update</code>
  1. Install the Elixir package by executing the following command:
<code>sudo apt-get install elixir</code>

Option 3: Installing Elixir on Windows[edit]

  1. Download the latest Windows installer for Elixir from the official website.
  1. Run the installer and follow the on-screen instructions to complete the installation.

Option 4: Installing Elixir using asdf[edit]

  1. Install asdf version manager by executing the following command:
<code>git clone https://github.com/asdf-vm/asdf.git ~/.asdf</code>
  1. Add asdf to your shell initialization file (e.g., ~/.bashrc) by executing the following command:
<code>echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc</code>
  1. Install the Erlang plugin by executing the following command:
<code>asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git</code>
  1. Install the Elixir plugin by executing the following command:
<code>asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git</code>
  1. Install the required versions of Erlang and Elixir:
<code>asdf install erlang <version></code>
<code>asdf install elixir <version></code>

Verifying the Installation[edit]

  1. Open a new terminal window and run the following command to check the installed Elixir version:
<code>elixir --version</code>
  1. To verify the Erlang installation, run the following command:
<code>erl</code>
  1. Press `Ctrl + G` to enter the Erlang shell, then type `q().` and press Enter to exit.

Additional Resources[edit]