Skip to content
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

bug: asdf not added to path after install #1792

Open
echosys opened this issue Oct 16, 2024 · 0 comments
Open

bug: asdf not added to path after install #1792

echosys opened this issue Oct 16, 2024 · 0 comments
Labels

Comments

@echosys
Copy link

echosys commented Oct 16, 2024

Describe the Bug

asdf not added to path after install
using osx sonoma
might be missing some directions but I could not find any more steps to try

Steps to Reproduce

1 install asdf from https://asdf-vm.com/guide/getting-started.html
brew install asdf
run echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
in my zshrc I see
. /usr/local/opt/asdf/asdf.sh
. /usr/local/opt/asdf/libexec/asdf.sh
2 asdf plugin add ruby
asdf install ruby latest
asdf global ruby 3.3.5
ruby -v is still 2.6 system ruby
3 went thought #785 asdf is working no errors, it is in path, the issue is the shim is not in path before system ruby, #531 I tried asdf reshim ruby
still
type -a ruby
ruby is /usr/bin/ruby
echo $PATH still has /user/bin first
also redid all the home brew instructions for brew install asdf https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh

4 since it is not working I also run through all the stackoverflow posts and in bashprofile I also have
. "/usr/local/opt/asdf/etc/bash_completion.d/asdf.bash"
. "/usr/local/opt/asdf/libexec/asdf.sh"
I also followed #837
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ~/.zshrc
and checked
.tool-versions has ruby 3.3.5
same instruction was provided in asdf-vm/asdf-ruby#103

I used echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
which added /usr/local/opt/asdf/asdf.sh to my .zshrc and this fixed my problem.

5 additional check I have done
asdf list ruby
*3.3.5
after adding to my.zshrc, my type -a ruby still only has /usr/bin/ruby, those are all the stackoverflow github issues I can find and tried

6 I also see some conflicting info #891

In other words, you no longer need
echo -e "\n. $(brew --prefix asdf)/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc which was a bad idea to begin with.

Expected Behaviour

$ type -a ruby
ruby is /Users/host/.asdf/shims/ruby
ruby is /usr/bin/ruby

Actual Behaviour

$ type -a ruby
ruby is /usr/bin/ruby

Environment

asdf info
OS:
Darwin C02G48SKMD6R 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:28:58 PST 2023; root:xnu-10002.81.5~7/RELEASE_X86_64 x86_64

SHELL:
zsh 5.9 (x86_64-apple-darwin23.0)

BASH VERSION:
3.2.57(1)-release

ASDF VERSION:
v0.14.1

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/lge11/.asdf
ASDF_DIR=/usr/local/opt/asdf/libexec
ASDF_CONFIG_FILE=/Users/lge11/.asdfrc

ASDF INSTALLED PLUGINS:
ruby                         [email protected]:asdf-vm/asdf-ruby.git master 645ca9e

asdf plugins affected (if relevant)

No response

@echosys echosys added the bug label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant