Asdf: reshim not working

Created on 13 Jun 2017  Â·  6Comments  Â·  Source: asdf-vm/asdf

I removed some gems and reshim won't remove the gem references:

$ which ruby
/usr/local/opt/asdf/shims/ruby
$ gem list

*** LOCAL GEMS ***

bigdecimal (default: 1.3.0)
bundler (1.15.1)
io-console (default: 0.4.6)
json (default: 2.0.2)
openssl (default: 2.0.3)
psych (default: 2.2.2)
rdoc (default: 5.0.0)

$ which kitchen
/usr/local/opt/asdf/shims/kitchen

$ cat $(which kitchen)
#!/usr/bin/env bash
# asdf-plugin: ruby
exec /usr/local/opt/asdf/libexec/private/asdf-exec ruby bin/kitchen "$@"

I would like kitchen to go away in this instance.

Most helpful comment

As someone who just backed away from asdf because of its use of shims (I left rbenv after a year of being annoyed with its shims), altering $PATH and other environment variables is pretty much the only sane way to do this, like chruby does.

All 6 comments

Hi, thanks for reporting.
This was not possible when the reshim command was implemented.
It now should be possible thanks to https://github.com/asdf-vm/asdf/pull/122,
but nobody has started working on it yet AFAIK, so PR are very welcome.

There is some code for removing shims but thats only made at plugin removal (ie all versions are uninstalled). How would you deal the case where kitchen is also installed for another version. Even now we share the shims between all versions, I mean, if you install kitchen with one ruby version, a shim for it is created, if you switch to another version via asdf, the shim already exist, but it wont likely work, as that another ruby version has no kitchen installed.

I think shims need to be locally scoped. rbenv handles shims really well.
I switched back to rbenv until this gets resolved :)

On Wed, Jun 14, 2017 at 7:51 AM, vic notifications@github.com wrote:

There is some code for removing shims but thats only made at plugin
removal (ie all versions are uninstalled). How would you deal the case
where kitchen is also installed for another version. Even now we share
the shims between all versions, I mean, if you install kitchen with one
ruby version, a shim for it is created, if you switch to another version
via asdf, the shim already exist, but it wont likely work, as that another
ruby version has no kitchen installed.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/asdf-vm/asdf/issues/200#issuecomment-308421239, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA1UirymORYSkLBoCQ1FgNUkmmADFsSyks5sD9dJgaJpZM4N4-Jn
.

Yep, I was also thinking of locally scoped shims, maybe having their own versioned directory and having asdf switch to it on version select. That would be a major change on how shims currently work. @asdf-vm/maintainers ideas?

Are there any bugs that are caused by this behavior? If we have separate directories we are going to have to fiddle with $PATH, and that's something I'd really like to avoid. One of things that drew me to asdf was the fact that it didn't alter path and only required two additional directories to be added to it.

@asdf-vm/maintainers can you think of a way of doing this that doesn't require on the fly changes to $PATH?

As someone who just backed away from asdf because of its use of shims (I left rbenv after a year of being annoyed with its shims), altering $PATH and other environment variables is pretty much the only sane way to do this, like chruby does.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Antiarchitect picture Antiarchitect  Â·  3Comments

robsonpeixoto picture robsonpeixoto  Â·  4Comments

tomsquest picture tomsquest  Â·  4Comments

michalmuskala picture michalmuskala  Â·  5Comments

ypid picture ypid  Â·  3Comments