asdf: bug: reshim does not update asdf path
Describe the Bug
jason@Jasons-Work-MacBook-Air ~/f (jax/webpack-quiet)> echo $ASDF_DIR
/opt/homebrew/Cellar/asdf/0.9.0/libexec
jason@Jasons-Work-MacBook-Air ~/f (jax/webpack-quiet)> cat ~/.asdf/shims/dotenv
#!/usr/bin/env bash
# asdf-plugin: ruby 3.0.2
exec /opt/homebrew/Cellar/asdf/0.8.1_1/libexec/bin/asdf exec "dotenv" "$@"
jason@Jasons-Work-MacBook-Air ~/f (jax/webpack-quiet)> asdf reshim ruby
jason@Jasons-Work-MacBook-Air ~/f (jax/webpack-quiet)> cat ~/.asdf/shims/dotenv
#!/usr/bin/env bash
# asdf-plugin: ruby 3.0.2
exec /opt/homebrew/Cellar/asdf/0.8.1_1/libexec/bin/asdf exec "dotenv" "$@"
Might be related to #1103
Steps to Reproduce
Before upgrading to 0.9.0 via homebrew:
- Install ruby via asdf
- gem install dotenv
- Update asdf to 0.9.0 via homebrew
- Run
asdf reshim ruby
- Path in
~/.asdf/shims/dotenv
is still incorrect
Note: Untested
Expected Behaviour
In step 5 the dotenv shim should have the 0.9.0 path
Actual Behaviour
The path in the dotenv shim has the old 0.8.1 path
Environment
OS:
Darwin Jasons-Work-MacBook-Air.local 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 arm64
SHELL:
fish, version 3.3.1
ASDF VERSION:
v0.9.0
ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/opt/homebrew/Cellar/asdf/0.9.0/libexec
ASDF INSTALLED PLUGINS:
elixir https://github.com/asdf-vm/asdf-elixir.git master 63e9cd8
erlang https://github.com/asdf-vm/asdf-erlang.git master 9ca2dea
nodejs https://github.com/asdf-vm/asdf-nodejs.git master 95a2091
ruby https://github.com/asdf-vm/asdf-ruby.git master de87a40
asdf plugins affected (if relevant)
ruby https://github.com/asdf-vm/asdf-ruby.git master de87a40
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 46
- Comments: 25 (2 by maintainers)
Commits related to this issue
- fix: `reshim` did not rewrite executable path (#1311) Co-authored-by: James Hegedus <jthegedus@hey.com> Fixes https://github.com/asdf-vm/asdf/issues/1115 Fixes https://github.com/asdf-vm/asdf/issue... — committed to fox-forks/asdf by dylan-chong 2 years ago
- fix: `reshim` did not rewrite executable path (#1311) Co-authored-by: James Hegedus <jthegedus@hey.com> Fixes https://github.com/asdf-vm/asdf/issues/1115 Fixes https://github.com/asdf-vm/asdf/issue... — committed to shakefu/asdf by dylan-chong 2 years ago
I just updated asdf via brew and everything seems broken.
I opened up the
~/.asdf/shims
directory in vscode and it looks like nothing is shimmed correctly.I tried running
asdf reshim
but with no luck.I’m just going to do a mass replace via VS Code on the directory 🤷
Edit: Reading the above comment this is much cleaner:
This helped me: https://github.com/asdf-vm/asdf/issues/1103#issuecomment-990795248
@SokichiFujita Try to remove old shims and reshim asdf
Thank you!
Removing old shims and then asdf reshim worked nicely!
rm ~/.asdf/shims/* asdf reshim
Had similar problem after a program reinstalled asdf. This ended up doing the trick:
This is a bug we need to fix. In the meantime https://github.com/asdf-vm/asdf/issues/1103#issuecomment-990795248 is a good workaround that shouldn’t cause any future issues for you all.
Same issue using fish shell with 0.9.0 installed with homebrew
I got it working again by deleting
~/.asdf
and reinstalling all plugins/packages 😭Had the same issue with 0.10.0, this helped https://github.com/asdf-vm/asdf/issues/1115#issuecomment-1018009184
I have a PR to fix reshim. Was actually a really simple fix https://github.com/asdf-vm/asdf/pull/1311
I just had to do this again recently and couldn’t find this old thread lol.
I appear to be having the same problem. Update: I restarted and was able to use asdf as expected.