Texte alternatif de l'image (home) ../

Install Elixir With Asdf On Centos 9

In this guide, we will walk you through the process of installing Erlang and Elixir using asdf on CentOS 9. asdf is a version manager that allows you to manage multiple runtime versions on a per-project basis. This makes it easy to switch between different versions of Erlang and Elixir for different projects.

Step 1: Install asdf

First, we need to install asdf. Clone the asdf repository to your home directory:

git clone https://github.com/asdf-vm/asdf.git ~/.asdf

Step 2: Update .zshrc Plugins

Next, we need to update our .zshrc file to include asdf. Open your .zshrc file and add asdf to the plugins list:

plugins=(asdf)

This ensures that asdf is loaded whenever you start a new terminal session.

Step 3: Install Erlang and Elixir Plugins

Now, let’s add the plugins for Erlang and Elixir and install the latest versions.

Install Erlang

Add the Erlang plugin:

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

Then, install the latest version of Erlang:

asdf install erlang latest

Install Elixir

Add the Elixir plugin:

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

Then, install the latest version of Elixir:

asdf install elixir latest

Step 4: Set Global Versions

Finally, set the global versions of Erlang and Elixir:

asdf global erlang <version>
asdf global elixir <version>

Replace <version> with the version number you installed in the previous steps.

That’s it! You now have Erlang and Elixir installed using asdf on CentOS 9. You can verify the installations by running the following commands:

erl -v
elixir --version

You should see the version numbers of Erlang and Elixir displayed in the output.


References: