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:

  1. Install ruby via asdf
  2. gem install dotenv
  3. Update asdf to 0.9.0 via homebrew
  4. Run asdf reshim ruby
  5. 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

Most upvoted comments

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 🤷 image

Edit: Reading the above comment this is much cleaner:

rm ~/.asdf/shims/*
asdf reshim

@SokichiFujita Try to remove old shims and reshim asdf

rm -f ~/.asdf/shims/*
asdf reshim

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 🤷 image

Edit: Reading the above comment this is much cleaner:

rm ~/.asdf/shims/*
asdf reshim

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:

unset ASDF_DIR

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 😭

I have a PR to fix reshim. Was actually a really simple fix https://github.com/asdf-vm/asdf/pull/1311

@ctsstc That did it! Thanks man!

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.