A Guide to Elixir Installation with asdf

A Guide to Elixir Installation with asdf

There are plenty of cases where you will have to use a particular version for a project and a different version for another project.

If you have Elixir installed without using a version manager, you will have issues switching between versions

This is very important while programming in Elixir, which requires Erlang. In this short article, we will go through how to install different versions of Elixir and Erlang using ASDF on macOS.

ASDF can be used for many programming languages which include ruby, node js, elixir, erlang etc

Install asdf

brew install asdf

After installing asdf, you need to install plugins. Plugins are the different languages you are choosing to manage with Asdf. We will be using asdf-erlang and asdf-elixir.

Add Elixir Plugin

asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git

Add Erlang Plugin

asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git

We will need to list all versions of elixir and erlang to know the version to install.

List Erlang versions

asdf list-all erlang

Install Erlang

asdf install erlang <version_no>

List Elixir versions

asdf list-all elixir

Install Elixir

asdf install elixir <version_no>

Check Elixir version

elixir --version

In conclusion, asdf is a versatile tool that simplifies the installation process of Elixir and its dependencies, such as Erlang. By following the steps outlined in this guide, you can easily set up your development environment and start exploring the exciting world of Elixir programming.