asdf: Version command fails on macOS after first installation
Steps to reproduce
$ brew install asdf
Follow instructions from #425
$ asdf version
Expected behavior
asdf should display program version
Actual behavior
cat: /usr/local/VERSION: No such file or directory
version:
cat: /usr/local/help.txt: No such file or directory
Environment
OS: macOS 10.14.2
asdf version: 0.6.2
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 64
- Comments: 23 (9 by maintainers)
Commits related to this issue
- Fix brew's asdf installation locally https://github.com/asdf-vm/asdf/issues/428 — committed to lucasnar/dotfiles by deleted user 5 years ago
- temporary fix issue https://github.com/asdf-vm/asdf/issues/428 — committed to gvlekke/dotfiles by deleted user 5 years ago
I encountered the same error and was due to wrong initialiser command in the wrong rc file I am on macOS 14.4.5, asdf 0.7.2,zsh with on_my_zsh, using asdf via homebrew What worked for me
restart terminal
I am having this issue as well using homebrew. I suspect this function is not working as expected when running from brew https://github.com/asdf-vm/asdf/blob/786fac791c242bee9222ceac792b6b78847cbb24/lib/utils.sh#L12
While looking into this a bit more, I found that
${BASH_SOURCE[0]}
evaluates to/usr/local/lib/utils.sh
which seems a bit odd, as it’s not namespaced in any way.utils.sh
seems a bit generic to be in a genericlib
dir. I’m not familiar with brew’s expectations and linking strategy, but everything else in this dir is named according to it’s package.So ultimately what is happening is:
As a temporary workaround, you can set the env var
ASDF_DIR
usingbrew --prefix
Or, to save the startup time from evaluating the
brew
command, just hardcode the value in. It looks pretty stable. (for me,/usr/local/opt/asdf
)Until this is fixed, you should add this line to your
~/.bash_profile
.I am having this same issue with 0.7.2 (macOS 10.14.4 + Bash), too.
The Actual behavior from the OP is what I see no matter which
asdf
command I try to run.Adding
source `brew --prefix asdf`/asdf.sh
to my.bash_profile
solved the problem.Anyone else having this same issue with any
asdf
command? If yes, should the title for this issue be changed to something more generic than related to only the version command?I had the same issue and was able to fix it by sourcing the homebrew install location. I add this to my
config.fish
.Other shells should be able to use a similar solution.
This appears to have been fixed, along with a few other things.
asdf version: 0.7.0 installed via homebrew
Running
asdf version
orasdf --version
produced no error.I am not setting or exporting
ASDF_DIR
manually.bash completions work out of the box, no need to source manually (if you have either followed the homebrew instructions for bash completion, or have properly installed the
bash-completion
orbash-completion@2
packages)When listing/installing plugins, data is placed in
~/.asdf/
Working nicely for this new asdf user.
We’ve again updated the documentation to further remove confusion on setup of the various combinations of OS, Shell and Install Method (see https://asdf-vm.com/#/core-manage-asdf-vm?id=install-asdf-vm). I believe this should remove the confusion for future
asdf
users.Given that adding the correct asdf setup script to the correct
rc
file was the primary issue discussed here I am marking this issue as solved.Please open an new issue should anyone discover further issues. Thanks for your time reporting and helping one another.
Just to follow up on this…
Seems like this was just clarified in official docs, i.e. https://github.com/asdf-vm/asdf/issues/428#issuecomment-507058409 is part of the doc now. No fix is expected here either from
brew
or fromasdf
Install asdf (click to expand)
https://asdf-vm.com/#/core-manage-asdf-vm?id=install-asdf-vm
This should probably be fixed by the brew installer. I came here because the very first thing I tried after installing via
$ brew install asdf
was simply$ asdf
and got this error message. I use ZSH. Maybe it’s handled for Bash? There’s a thing in the brew installer about adding some line to your.bash_profile
for completions, but I would only do that if I wanted completions. I expect/(hope for) the brew installation to just work.Sure! Here is what I have. I think I ran into similar issues with
asdf
back in the day as well. It’s almost as if it assumes agit clone
was ran, and the appropriate config files were created. Where as installing it usingbrew install asdf
just never seems to work for me.@tveon I have tried to get these into caveats of the Homebrew formula, see https://github.com/asdf-vm/asdf/issues/785 - the Homebrew maintainers say it isn’t a “caveat” and our documentation site should detail the steps. Needless to say, our docs do share this information, the Homebrew workflow has trained people to not lookup the documentation for the tools they install, they expect Homebrew to do it all. Since we don’t want
asdf
to modify shell configs this is the position we find ourselves in.Hi all,
I will add another section for Catalina since macOS now defaults to zsh and this can cause confusion.this was already done, however not visually clear.However, if the step of adding
asdf
to your shell’s profiles is skipped then it will not work as expected. I’m unsure how the Brew package is managed, but for user experience if we can get it to modify the profile with the correct brew dir then that would be preferred.I am looking into documentation site improvements to make the 2 steps be displayed more succinctly and only the instructions you need for your usage to be display. Thanks for the feedback all 🙏
I’m in the same boat as @heydonovan.