Emily

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

Emily

Here’s what finally worked:

To set the version of Elixir:

  1. Open a terminal window.
  2. Navigate to your home directory by running the following command: cd ~
  3. Check if the .tool-versions file exists by running ls -a. If it doesn’t exist, create it by running touch .tool-versions.
  4. Open the .tool-versions file with a text editor of your choice. For example, you can use the following command to open it with nano: nano .tool-versions
  5. Add the following line to the file: elixir 1.13.2-otp-24.
  6. Save the changes and exit the text editor.

To check the current version of Elixir:

  1. Open a terminal window.
  2. 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

Stratus3D

Asdf Core Team

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

massimo

two things you can try

asdf reshim

and

export PATH=~/.asdf/shims:$PATH

AriBernstein

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

cloudytoday

Is mix binary present in $HOME/.asdf/shims/mix? Did you do asdf global elixir (version)?

dimitarvp

dimitarvp

Same effect should be achievable by running asdf global elixir 1.13.2-otp-24 btw.

Where Next?

Popular in Questions Top

yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement