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.

Last Post!

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.

Where Next?

Popular in Questions Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
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
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement