Skip to content

Install elixir environment for windows

Austin Hammer edited this page Apr 5, 2023 · 1 revision

Install linux for windows (WSL2)

Make sure virtualization is enabled via the system bios beforehand wsl --install

This will install ubuntu by default.

Install ASDF in the Ubuntu virtualized environment

sudo apt-get update 
sudo apt install autoconf bison build-essential libssl-dev libyaml-dev \
                  libreadline-dev zlib1g-dev libncurses-dev libffi-dev \
                  libgdbm-dev curl git unzip
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3

Add ASDF to the path on startup

Add to the end of .bashrc, file is located at the root directory

. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"

Restart your terminal or source .bashrc

Add plugins to ASDF

asdf plugin add erlang
asdf plugin add elixir

Install erlang and elixir

In the root of the project environment, there is a file called .tool_versions.
cat .tool_versions to get the current versions of erlang and elixir.

asdf install erlang $ERLANG_VERSION
asdf install elixir $ELIXIR_VERSION