You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found an interesting asdf edge case I'm not sure how to solve. It's related to this plugin and the auto-reshimming feature of some language plugins like Ruby. I opened a ticket in the asdf-ruby repo but I also want to raise it here because I realized this is a generic problem related to alias versions.
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? One option would be to relax the reshim command to reshim all known Ruby versions, but that would be bad for performance. The auto-reshim in asdf-node and asdf-python do this exactly, but I hope there is a better way.
Steps to reproduce
Expected behavior
Screenshots
Additional context
The text was updated successfully, but these errors were encountered:
I've never had a lot of luck using aliases for ruby versions in any tool. Ruby can be finicky and strict about the versions of gems being used during execution. Especially when it comes to gems that install / compile native extensions which link to specific absolute paths.
Having a quick look at the asdf-ruby plugin, the hook you describe is a rubygem plugin and this must be where the RUBY_VERSION is coming from. It doesn't appear the asdf-ruby plugin does much with this itself and just registers the path containing the hook to ruby gems. If there is a workaround it would likely be in this realm.
Since this is unlikely an issue with the asdf-alias plugin itself, I'm going to close the issue. I've linked this to asdf-vm/asdf-ruby#399 for reference.
NOTE: I've switched from asdf to mise which doesn't require shimming. You could try it you may and have better luck with your particular use case. However, I can't say for sure since I don't alias ruby versions for the reasons I mentioned above.
Describe the bug
I found an interesting asdf edge case I'm not sure how to solve. It's related to this plugin and the auto-reshimming feature of some language plugins like Ruby. I opened a ticket in the asdf-ruby repo but I also want to raise it here because I realized this is a generic problem related to alias versions.
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 isasdf reshim 3.2.0
instead ofasdf reshim 3.2
.Does anyone have a clever idea to work around this? One option would be to relax the reshim command to reshim all known Ruby versions, but that would be bad for performance. The auto-reshim in
asdf-node
andasdf-python
do this exactly, but I hope there is a better way.Steps to reproduce
Expected behavior
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: