Mix (elixir) no such file or directory
Asked Answered
R

4

8

I am trying to install elixir in ubuntu... I had followed this instructions.

Everthing seems fine, but when I try to execute the mix comand, system asnwered me this:

bash: /usr/bin/mix: No such file or directory

Thanks you.

Rescue answered 28/9, 2016 at 15:41 Comment(11)
Is that the exact error message? Can you paste the exact one if it's not?Throwback
Hi @Throwback It says bash, not bahs... and the output is in spanish... But yes It is exactly the error message.Hellespont
It says "/user/bin_mix"?Throwback
Ouch!! Sorry, sorry, sorry... I am edittingHellespont
Does it say /user or /usr ? /usr would be the standard place for it to be--/user would not be. What happens if you type /usr/bin/mix?Longueur
sorry!! I was too tired... :( now it is correctly, sorry.Hellespont
Maybe you forgot to cd into directory where mix.exs file is available ( mix isn't a global command that works everywhere)Charentemaritime
OMG!!! I was toooooo tired!!! Thanks @OleksandrAvoyants that is the solution!!!Hellespont
ok )) I will add an answer than to make it clear.Charentemaritime
I don't see how being in a directory without mix.exs can cause "/usr/bin/mix: No such file or directory". You can run mix from any directory after installing Elixir. If you run it from a directory without mix.exs, you'll just get an error like "** (Mix) Could not find a Mix.Project, please ensure a mix.exs file is available".Throwback
Yes you are right, yesterday I thought that this is kind of error when people do rails new demo && rails server instead of rails new demo && cd demo && rails server. But now when I read this, seems that it doesn't have sense :)Charentemaritime
I
4

Just ran into the same problem. The guide you linked installs mix to /usr/local/bin/mix instead of /usr/local/mix. I created a symlink /usr/bin/mix but expanding $PATH is probably a better way to fix this.

~$ mix
-bash: /usr/bin/mix: No such file or directory
~$ which mix
/usr/local/bin/mix
~$ sudo ln -s /usr/local/bin/mix /usr/bin/mix
~$ mix
** (Mix) Could not find a Mix.Project, please ensure a mix.exs file is available
Ironlike answered 27/2, 2017 at 10:43 Comment(0)
J
1

in my case i have installed elixir using sudo so when you try to call it without sudo you'll get this error.

Jorin answered 5/5, 2019 at 12:25 Comment(0)
E
0

Also ran into this. In my case it stemmed from having CDPATH set.

Unsetting it for the session with unset CDPATH and retrying did the trick.

Elwood answered 23/4, 2017 at 4:17 Comment(0)
N
0

In my case I reinstalled Erlang via sudo apt-get install erlang-base and during installation, Elixir got removed altogether.

Fixed that by running sudo apt-get install elixir.

All repositories were preset for me already.

Nasturtium answered 9/10, 2019 at 15:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.