asdf-vm / asdf-ruby

Ruby plugin for asdf version manager
https://github.com/asdf-vm/asdf
MIT License
657 stars 133 forks source link

Auto-reshim is broken when using the asdf-alias plugin #399

Open ofalvai opened 5 months ago

ofalvai commented 5 months ago

I found an interesting asdf edge case I'm not sure how to solve. It's related to the asdf-alias plugin and the auto-reshimming feature of some language plugins like Ruby.

The problem: this hook uses the Ruby constant RUBY_VERSION, and when the active Ruby version is an alias version (which is a symlink to a concrete version), this results in an incorrect reshim command. For example, when the active version is 3.2, the executed command is asdf reshim 3.2.0 instead of asdf reshim 3.2.

Does anyone have a clever idea to work around this from the asdf-ruby side? One option would be to relax the reshim command to reshim all known Ruby versions, but that would be bad for performance.