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

Wrong cellar path #292

Open
manuraj17 opened this issue Aug 12, 2022 · 5 comments
Open

Wrong cellar path #292

manuraj17 opened this issue Aug 12, 2022 · 5 comments

Comments

@manuraj17
Copy link

Noticed this behaviour with asdf and ruby gems recently.
I have had asdf installed for a while now. I use it for all my language versioning.

Recently after installing gems at a global level and after asdf reshim I found that the shim file created points to a wrong cellar. I manually updated and it started working. Not sure what I missed here or is it a genuine issue. If someone can direct on how I can gather data/steps I can dig into this further.

Output of asdf info

SHELL:
zsh 5.8.1 (x86_64-apple-darwin21.0)

ASDF VERSION:
v0.10.2

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/usr/local/Cellar/asdf/0.10.2/libexec

ASDF INSTALLED PLUGINS:
elixir                       https://github.com/asdf-vm/asdf-elixir.git master 8d018f2
erlang                       https://github.com/asdf-vm/asdf-erlang.git master 98139db
flutter                      https://github.com/oae/asdf-flutter.git master d108efd
golang                       https://github.com/kennyp/asdf-golang.git master cc8bc47
java                         https://github.com/halcyon/asdf-java.git master 67a9c5a
kotlin                       https://github.com/asdf-community/asdf-kotlin.git master af9ab2c
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master f9957f3
python                       https://github.com/danhper/asdf-python.git master 57a4d72
ruby                         https://github.com/asdf-vm/asdf-ruby.git master 95bb530
rust                         https://github.com/code-lever/asdf-rust.git master 0c88f99

I installed the rufo gem and the shim file has content as below

❯ cat /Users/manuraj/.asdf/shims/rufo
#!/usr/bin/env bash
# asdf-plugin: ruby 3.0.3
# asdf-plugin: ruby 3.1.1
exec /usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf exec "rufo" "$@"

The cellar path should be of version 0.10.2 in the info but 0.9.0 due to which I was not able to access rufo globally.
I manually changed and it is now

❯ cat /Users/manuraj/.asdf/shims/rufo
#!/usr/bin/env bash
# asdf-plugin: ruby 3.0.3
# asdf-plugin: ruby 3.1.1
exec /usr/local/Cellar/asdf/0.10.2/libexec/bin/asdf exec "rufo" "$@"

And rufo works now.

Apologies in advance for this vague issue, I really like to figure what went wrong but am not sure where to start.

@Qqwy
Copy link

Qqwy commented Aug 18, 2022

I encountered this exact issue in the wild. With rufo as well as with rubocop. I think this is a wider issue that must have been introduced in a recent update to the ruby ASDF plugin.

@manuraj17
Copy link
Author

@Qqwy Interesting, what did you face with rubocop? I was checking rubocop and it doesn't be configured like rufo (Now that I said this, I doubt if I have it installed globally, hhmm)
Anyways, was rubocop also having exact issue?

@Qqwy
Copy link

Qqwy commented Aug 21, 2022

Upon reflection, I think my problem might have been caused by something else. My GEM_PATH was all messed up for some reason. If I figure out what was happening exactly I will let you know. But before then: please disregard my earlier message 😅.

@edsonlima
Copy link

edsonlima commented Dec 27, 2022

Hi,

I faced some similar issue here.

I use asdf for deploy in some scenarios where I need more than one version of ruby, using systemd scripts for startup.

But recently, the "bundle" script command (e.g: /path/to/.asdf/installs/ruby/3.1.2/bin/bundle), for example, points to "#!/usr/bin/env ruby" instead of "/path/to/.asdf/installs/ruby/3.1.2/bin/ruby", and the startup fails. So, I need to edit all scripts to point to correct ruby version.

EDIT:
It doesn't occur in all scripts, however.

@pboling
Copy link

pboling commented Dec 27, 2022

All my ruby shims recently (within the last year) broke. All point to 0.10.1 instead of 0.10.2. I have been fixing them manually as needed. I don't know what caused it, but it was a somewhat recent change, probably in the last year. I don't know if it affected other asdf plugins, as I mostly use Ruby, but IIRC there are other issues for this same problem in the tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants