ASDF is a cli used to manage the installation and runtime versions of several popular languages. I've recently found out about asdf, and used it to run a quick update on my local machine. This article will provide a quick tutorial on the installation and update process.
To install asdf, first clone the most recent stable release from the github repository:
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.8
Then, add it as an environment variable to bash
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
You can then install any language from these list of plugins. We will be installing the most recent version of erlang and elixir using these plugins.
asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
To install elixir, the installation instructions dictate you must have unzip installed first. Run the following commands
sudo apt install unzip && asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
You can install hex and rebar by running the following command
mix local.hex --if-missing --force && mix local.rebar --if-missing --force
.tool-versions file is the file which asdf uses to determine which installed version of the language your project uses. U can set up a global
.tool-versions for asdf to fall back on if your current folder doesn't have a
.tool-versions present. Run the following command.
echo -e '\n elixir 1.10.2 \n mix 1.10.2' >> $HOME/.tool-versions