asdf-ruby
asdf-ruby copied to clipboard
Ruby 2.4.1 is installed, yet can't be selected with asdf
asdf-ruby works on my machine well, but not for 2.4.1 . Somehow it yells that 2.4.1 doesn't exist even though it does.
I updated both asdf and asdf-ruby to the newest version and it didn't help. Removing and installing 2.4.1 again also didn't help.
Anybody ever had this issue? Any idea how to fix it?
asdf --version
# v0.8.0
asdf plugin list --urls --refs
# ruby https://github.com/asdf-vm/asdf-ruby.git master 101e86a
asdf list ruby
# 2.4.1
# 2.5.7
# 2.6.6
asdf shell ruby 2.6.6
ruby -v
# ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]
asdf shell ruby 2.5.7
ruby -v
# ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-darwin19]
asdf shell ruby 2.4.1
ruby -v
# No preset version installed for command bundle
# Please install a version by running one of the following:
#
# asdf install ruby 2.4.1
#
# or add one of the following versions in your config file at /Users/slimak/.tool-versions
# ruby 2.5.7
# ruby 2.6.6
# ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin19]
having same issue with 2.5.7
Did some debug digging, this one is interesting:

It works in zsh shell but not in fish.
Wow, I've found a workaround for this. I had to install bundler for that given ruby version. And after that ruby -v started working:

I wonder what should be the solution to this. Should we add documentation? Should the terminal say "please install bundler now using ..." after installing new ruby version? Perhaps asdf-ruby should do it automatically?
Strange. Does asdf reshim fix this? What happens if you only run asdf reshim and don't install bundler?
I'm pretty sure I did try asdf reshim and it didn't help. I'm only 90% sure though. Now I got it working, so unfortunately I can't answer you on this.
Same problem here with ruby 2.5.3. I tried uninstalling and installing it again and running asdf reshim.
$ bundle install
No preset version installed for command bundle
Please install a version by running one of the following:
asdf install ruby 2.5.3
or add one of the following versions in your config file at /Users/nicolasgarnil/workspace/convocacion/convocacion-crm/.tool-versions
ruby 2.6.5
ruby 2.3.8
ruby 2.7.1
ruby 2.4.10
ruby 2.4.0
ruby 2.6.6
I switched to ruby 2.6.5 and bundle install worked without any issues.
@nicolasgarnil did my asdf exec gem install bundler fix the issue for you?
@nicolasgarnil did my
asdf exec gem install bundlerfix the issue for you?
fixed for me, thank you!
asdf exec gem install bundler
I am having this issue with 2.5.7. This did not fix it for me, nor did reinstalling or asdf reshim.
I'm using v0.8.0 on OS 10.14.5 installed via Homebrew.
I used to have 2.5.7 installed via rvm. While it's no longer there, one thing I did notice is that versions that were never installed with rvm work fine.
Also rvm directories have been cleared from my path. But even with them there, asdf has higher priority, i.e., its directory comes first.
I am facing this issue too:
% asdf install ruby 2.6.5
ruby 2.6.5 is already installed
% asdf local ruby 2.6.5
% ruby -v
No preset version installed for command ruby
Please install a version by running one of the following:
asdf install ruby 2.6.5
or add one of the following versions in your config file at /Users/fxn/prj/nw/nadinewest-oms/.tool-versions
ruby 2.7.1
ruby jruby-9.2.11.1
ruby 3.0.0
ruby 2.7.2
ruby 2.6.6
ruby truffleruby-dev
ruby 2.5.8
ruby 2.5.7
ruby 2.6.2
That session above is real but just for demo purposes, I jump in and out from that directory, reshim, asdf shell ..., etc., to no avail.
I uninstalled and reinstalled, and the problem disappeared.
I'm having the same issue, ruby version 2.5.9 I tried: reinstalling ruby, asdf reshim, asdf exec gem install bundler - nothing worked.
I finally solved the problem here editing manually the bundle shim (which bundle to get it), and adding my ruby version there:
#!/usr/bin/env bash
# asdf-plugin: ruby 2.5.9
# asdf-plugin: ruby 2.7.4
exec /opt/homebrew/opt/asdf/bin/asdf exec "bundle" "$@"
(the second line was missing)
I don't know if it's related, I'm using a Apple M1 - so the only way to install ruby for me is using: RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC asdf install ruby 2.5.9
I uninstalled and reinstalled, and the problem disappeared.
After going through 5 different links, this was the answer. Basically turning it off and back on haha. Thank you