asdf: /usr/local/libexec/private/asdf-exec: No such file or directory

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

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 13
  • Comments: 19 (2 by maintainers)

Most upvoted comments

This happened to me, not sure why, but I found a fix for it. It was working fine until today, maybe because oh-my-zsh upgraded this morning?

I installed asdf with homebrew and am using the asdf zsh plugin, which tries to load files that don’t exist:

/Users/bbugh/.oh-my-zsh/custom/plugins/asdf/asdf.plugin.zsh:source:4: no such file or directory: /Users/bbugh/.asdf/asdf.sh
/Users/bbugh/.oh-my-zsh/custom/plugins/asdf/asdf.plugin.zsh:source:5: no such file or directory: /Users/bbugh/.asdf/completions/asdf.bash

If I look at the ~/.asdf/shims/ruby shim for example, it’s pointing to a folder that doesn’t exist:

exec /opt/homebrew/Cellar/asdf/0.8.1_1/libexec/bin/asdf exec "ruby" "$@"

but my asdf is /opt/homebrew/Cellar/asdf/0.9.0. If I do asdf reshim, nothing changes:

» asdf reshim
» ruby -v
/Users/bbugh/.asdf/shims/ruby: line 4: /opt/homebrew/Cellar/asdf/0.8.1_1/libexec/bin/asdf: No such file or directory
/Users/bbugh/.asdf/shims/ruby: line 4: exec: /opt/homebrew/Cellar/asdf/0.8.1_1/libexec/bin/asdf: cannot execute: No such file or directory

Using which, the correct paths seems to be:

» which -a asdf
asdf () {
	local command
	command="$1"
	if [ "$#" -gt 0 ]
	then
		shift
	fi
	case "$command" in
		("shell") eval "$(asdf export-shell-version sh "$@")" ;;
		(*) command asdf "$command" "$@" ;;
	esac
}
/opt/homebrew/opt/asdf/libexec/bin/asdf ✅
/opt/homebrew/bin/asdf

Solution

I removed asdf plugin from ~/.zshrc, and then ran the command to add zsh to the file:

echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc

I started a new terminal session, and tried ruby -v again - no luck, same error.

Then I deleted all of the shims in ~/.asdf/shims and then ran asdf reshim again, and it correctly set the shim paths:

exec /opt/homebrew/opt/asdf/libexec/bin/asdf exec "node" "$@"

Seems like there’s an issue with asdf not reshimming correctly.

Yep. Same here. Weird that reshim wouldn’t recreate the files on a version mismatch.

❯ go version
/Users/matschaffer/.asdf/shims/go: line 3: /usr/local/Cellar/asdf/0.8.1_1/libexec/bin/asdf: No such file or directory
/Users/matschaffer/.asdf/shims/go: line 3: exec: /usr/local/Cellar/asdf/0.8.1_1/libexec/bin/asdf: cannot execute: No such file or directory

❯ rm -rf ~/.asdf/shims; asdf reshim

❯ go version
go version go1.17.3 darwin/amd64

Just commenting here that rm -rf ~/.asdf/shims; asdf reshim works for me as well. It broke kubectx and kubectl in my case.

rm -rf ~/.asdf/shims; asdf reshim fixes the errors for me. I can run yarn start now.

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 😉

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).

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

Some rogue homebrew command bumped me from 0.8.1 to 0.9 today for asdf, and I ran into the same issue with Elixir/Erlang via asdf. @bbugh solution above ☝️ worked for me

Ah. Looks like https://github.com/asdf-vm/asdf/issues/531 is open to address that. But googling “shims asdf no such file or directory” led me to this issue first.

Happening for me also. Is there a fix planned so users don’t have to hack around creating symlinks?

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