I was following this tutorial: https://www.mitchellhanberg.com/post/2017/10/05/installing-erlang-and-elixir-using-asdf/
$ asdf plugin-list
elixir
erlang
ruby
$ asdf current
elixir 1.7.4 (set by /Users/me/.tool-versions)
erlang 21.2 (set by /Users/me/.tool-versions)
ruby No version set for ruby; please run `asdf <global | local> ruby <version>`
$ elixir -v
/Users/me/.asdf/shims/elixir: line 4: /usr/local/libexec/private/asdf-exec: No such file or directory
/Users/me/.asdf/shims/elixir: line 4: exec: /usr/local/libexec/private/asdf-exec: cannot execute: No such file or directory
I could not find anything regarding my issue but I also did not find anything I might have missed in my installation
OS: macOs Sierra
asdf version: 0.6.2
I had the same problem.
To fix simply edit /Users/me/.asdf/shims/elixir and change the /usr/local/libexec/private/asdf-exec to /usr/local/Cellar/asdf/0.6.2/libexec/private/asdf-exec.
I think it is caused because I had an old asdf 0.6.0 which was missing the .zshrc activation (source /usr/local/opt/asdf/asdf.sh).
Thank you very much @look4regev it worked for me.
I just installed asdf v0.6.2 from homebrew so it is not due to an old version for me
I had the problem for nodejs and python
running this, avoids the edition of all shims:
sudo ln -s /usr/local/Cellar/asdf/0.6.2/libexec/ /usr/local/libexec
ln -s /usr/local/Cellar/asdf
By turning the command into
sudo ln -s /usr/local/opt/asdf/libexec/ /usr/local/libexec
you make it version unaware :wink:
thank you very much @tcoenraad
Happening for me also. Is there a fix planned so users don't have to hack around creating symlinks?
I ran into a similar error, using:
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
It seems to be working with homebrew using:
. $(brew --prefix asdf)/asdf.sh
I cannot reproduce this error anymore with 0.7.4
I had this issue just now on Ubuntu 19.04 using asdf 0.7.4.
I was trying to run rustc version 1.35.0 which was installed properly but asdf could not find it:
/home/me/.asdf/shims/rustc: line 3: /usr/local/opt/asdf/bin/asdf: No such file or directory
asdf is installed in $HOME/.asdf, on my machine and the /usr/local/opt folder did not exist.
What I did to fix it was first create the directory /usr/local/opt, then symlink $HOME/.asdf to /usr/local/opt/asdf:
sudo mkdir -p /usr/local/opt
sudo ln -s "$HOME/.asdf" /usr/local/opt/asdf
After this the rustc command started working properly again.`
Unfortunately I am unsure from which version I actually upgraded but I believe it was 7.1.0, in this version I did not have this issue without the /usr/local/opt directory.
Hope this helps anyone, good luck!
Closing this ticket because I don't believe this is an issue with the latest versions of asdf (0.8.0-rc1 and 0.7.8). Please upgrade if you encounter this issue.
Actually @Stratus3D I still do have this issue with 0.7.8 as well as 0.8.0-rc1, this is what I did:
• ~/D/rust/some-project ⚑ ❯ asdf --version
v0.7.8-40c492b
• ~/D/rust/some-project ⚑ ❯ ls /usr/local/opt
asdf@
• ~/D/rust/some-project ⚑ ❯ rustc --version
rustc 1.41.0 (5e1a79984 2020-01-27)
• ~/D/rust/some-project ⚑ ❯ sudo rm -rf /usr/local/opt
[sudo] password:
• ~/D/rust/some-project ⚑ ❯ asdf reshim
• ~/D/rust/some-project ⚑ ❯ rustc --version
/home/sidofc/.asdf/shims/rustc: line 6: /usr/local/opt/asdf/bin/asdf: No such file or directory
• ~/D/rust/some-project ⚑ ❯ asdf reshim
• ~/D/rust/some-project ⚑ ❯ rustc --version
/home/sidofc/.asdf/shims/rustc: line 6: /usr/local/opt/asdf/bin/asdf: No such file or directory
• ~/D/rust/some-project ⚑ ❯ asdf --version
v0.7.8-4a3e3d6
• ~/D/rust/some-project ⚑ ❯ asdf reshim
• ~/D/rust/some-project ⚑ ❯ rustc --version
/home/sidofc/.asdf/shims/rustc: line 6: /usr/local/opt/asdf/bin/asdf: No such file or directory
• ~/D/rust/some-project ⚑ ❯ asdf --version
v0.8.0-rc1-e0142ee
• ~/D/rust/some-project ⚑ ❯
After re-symlinking to /usr/local/opt it started working again.
Should I completely reinstall an asdf plugin, or is it something else I missed perhaps?
Edit:
Is there anything I can do to help? I'd be happy to help debug this issue :)
@SidOfc are you sure you installed asdf correctly? It seems like your ASDF_DATA_DIR or some other asdf path isn't corrrect on your system. Go to asdf-vm.com/ and select your OS and install type and verify you ran all the correct commands.
I noticed one instruction differs from what I've got, but it doesn't seem to change anything.
I use fish_user_paths to set up asdf like so:
set -U fish_user_paths $HOME/.asdf/bin $HOME/.asdf/shims
This works, and works for rust too as long as I have the symlink to /usr/local/opt in place.
According to the installation instructions I need to source $HOME/.asdf/asdf.fish, so I've changed my declaration to this:
set -U fish_user_paths $HOME/.asdf/asdf.fish
This still works, but when the symlink is removed I'm running into the same issue:

One interesting difference is that the ruby plugin does work correctly:

I checked the rust asdf plugin repo but it does not contain any references to /usr/local/opt so I don't think the issue lives in that repo, though I could have missed something.
I also tried asdf plugin-update --all which did update some plugins, including rust. After that I ran asdf reshim and checked if the shim for rustc changed but alas, it is still the same.
Would another idea be to reinstall asdf from scratch?
Most helpful comment
By turning the command into
sudo ln -s /usr/local/opt/asdf/libexec/ /usr/local/libexecyou make it version unaware :wink: