-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version command fails on macOS after first installation #428
Comments
I am having this issue as well using homebrew. I suspect this function is not working as expected when running from brew Line 12 in 786fac7
While looking into this a bit more, I found that So ultimately what is happening is: asdf_dir() {
if [ -z "$ASDF_DIR" ]; then
local current_script_path=${BASH_SOURCE[0]}
# => /usr/local/lib/utils.sh
export ASDF_DIR
ASDF_DIR=$(cd "$(dirname "$(dirname "$current_script_path")")" || exit; pwd)
# `dirname dir` returns the parent directory -- so we end up with
# => /usr/local/lib/utils.sh --> /usr/local/lib --> /usr/local
fi
echo "$ASDF_DIR"
} As a temporary workaround, you can set the env var $ export ASDF_DIR=$(brew --prefix asdf) Or, to save the startup time from evaluating the Until this is fixed, you should add this line to your |
This appears to have been fixed, along with a few other things. asdf version: 0.7.0 installed via homebrew Running # .bash_profile
. $(brew --prefix asdf)/asdf.sh I am not setting or exporting $ echo $ASDF_DIR
/usr/local/opt/asdf 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 When listing/installing plugins, data is placed in Working nicely for this new asdf user. |
Just installed
|
@heydonovan Could you show us the line you added to |
Sure! Here is what I have. I think I ran into similar issues with
|
I'm in the same boat as @heydonovan. |
I had the same issue and was able to fix it by sourcing the homebrew install location. I add this to my source (brew --prefix asdf)/asdf.fish Other shells should be able to use a similar solution. |
@AaronLasseigne great follow up. I forgot that I posted in here and have since found a solution. The above snippet posted by @AaronLasseigne doesn't quite work for my. My Here's what I have in my set --local BREW_PREFIX (brew --prefix)
[ -f $BREW_PREFIX/opt/asdf/asdf.fish ]
and source $BREW_PREFIX/opt/asdf/asdf.fish |
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 Adding Anyone else having this same issue with any |
This should probably be fixed by the brew installer. I came here because the very first thing I tried after installing via |
I encountered the same error and was due to wrong initialiser command in the wrong rc file
restart terminal |
It works for me @jagdishadusumalli thanks so much!! what's happening the scenes? |
Just to follow up on this... Seems like this was just clarified in official docs, i.e. #428 (comment) is part of the doc now.
Install asdf (click to expand)https://asdf-vm.com/#/core-manage-asdf-vm?id=install-asdf-vm |
Hi all, However, if the step of adding 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 🙏 |
If you don't care about installing it via Git and don't want to rewrite the ASDF_DIR env var and do some workarounds, just go for Git installation. |
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 Given that adding the correct asdf setup script to the correct Please open an new issue should anyone discover further issues. Thanks for your time reporting and helping one another. |
I also had to |
How about add these instructions to the homebrew formula? I.e. shown under "caveats". |
@tveon I have tried to get these into caveats of the Homebrew formula, see #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 |
Is there a homebrew issue where that was discussed (I looked but didn't find it)? A brief survey of other version-swiching tools shows that they all include their add-to-shell instructions in the Caveat field, so this seems at best inconsistent - and seemingly quite user-hostile. Do you think the maintainers would be pursuaded by a list of prior art in other homebrew formulae? |
@jthegedus do you have a link to the discussion with Homebrew maintainers? I can't find it. |
In #785 there's an expandable section which links to the discussion on the hombrew-core repo - this is that link Homebrew/homebrew-core#54315 - the linked issues piling up on the PR shows that this is an issue and comes up a lot, but were told it's not valid use of caveats. |
I had to reinstall asdf + asdf-ruby and then reinstall rubies to fix this. I was running 0.9 but shims was pointing to 0.8.1_1 dir. No changes in dotfiles required for me. |
Steps to reproduce
$ brew install asdf
Follow instructions from #425
$ asdf version
Expected behavior
asdf should display program version
Actual behavior
Environment
OS: macOS 10.14.2
asdf version: 0.6.2
The text was updated successfully, but these errors were encountered: