Emily
Installed Elixir via ASDF, shows successful but I’m getting “mix: command not found” errors
I installed Elixir using asdf. elixir -v shows the install was successful. Yet I’m getting “mix: command not found” errors.
~./bashrc path is referenced:
. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"
/etc/profile.d/elixir.sh is referenced:
export PATH=$PATH:/usr/local/lib/elixir/1.13.2-otp-24/bin
Erlang install is: erlang 24.2.1
Elixir install is: elixir 1.13.2-otp-24
I believe they are compatible.
I must be missing a path reference somewhere?
What am I doing wrong?
Marked As Solved
Emily
Here’s what finally worked:
To set the version of Elixir:
- Open a terminal window.
- Navigate to your home directory by running the following command:
cd ~ - Check if the
.tool-versionsfile exists by runningls -a. If it doesn’t exist, create it by runningtouch .tool-versions. - Open the
.tool-versionsfile with a text editor of your choice. For example, you can use the following command to open it with nano:nano .tool-versions - Add the following line to the file:
elixir 1.13.2-otp-24. - Save the changes and exit the text editor.
To check the current version of Elixir:
- Open a terminal window.
- Run the following command:
elixir -v.
This will display the version of Elixir that is currently set on your system. If you’ve followed the steps above and set the version to 1.13.2-otp-24, then running elixir -v should display that version.
Also Liked
Stratus3D
asdf maintainer here. There couple that could be causing this. If what @massimo said did not work, I’d suggest re-reading the asdf getting started guide (Getting Started | asdf) and make sure you follow the instructions for your operating system and interactive shell.
If you do all that and it still doesn’t work, it means there something else interfering with asdf in your shell. I’ve found the following commands to be helpful when debugging versions installed with asdf:
type -a mix
type -a elixir
Both of these commands should print out a one or more paths to mix and elixir executables on your machine. If things are working properly you should see the asdf shim paths listed first ($HOME/.asdf/shims/mix and $HOME/.asdf/shims/elixir).
massimo
two things you can try
asdf reshim
and
export PATH=~/.asdf/shims:$PATH
AriBernstein
Literally couldn’t figure out this issue over the last 3 hours and you post this 2 hours ago lol, thank you!
For anyone too lazy to open the link, remove all lines related to asdf from your .zshrc and add the following line:
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
Then, for good measure, run asdf reshim and close all terminal windows before trying to run mix ... again.
cloudytoday
Is mix binary present in $HOME/.asdf/shims/mix? Did you do asdf global elixir (version)?
dimitarvp
Same effect should be achievable by running asdf global elixir 1.13.2-otp-24 btw.







