asdf-ruby icon indicating copy to clipboard operation
asdf-ruby copied to clipboard

Changing ruby version with RUBY_VERSION

Open technicalpickles opened this issue 2 years ago • 2 comments

Coming from other version managers, one thing I'm missing is being able to use RUBY_VERSION in the environment to set it. I'm not sure if this is a general asdf problem, or one with this plugin.

For example:

❯ ruby --version
ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [arm64-darwin21]

❯ RUBY_VERSION=3.0.2 ruby --version
ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [arm64-darwin21]

I think at the least, it's worth mentioning in the "Migrating from another Ruby version manager" section.

technicalpickles avatar Aug 12 '22 16:08 technicalpickles

I have been looking for quite a while to find ASDF_RUBY_VERSION works for this. Still, having compatibility with other tools would be nice.

technicalpickles avatar Aug 12 '22 16:08 technicalpickles

asdf shell ruby <version> setting ASDF_RUBY_VERSION is the closest thing that we are going to support. The version resolution process is handled by asdf core and the ASDF_ prefix env variables are the only ones it reads during the version resolution.

Stratus3D avatar Aug 12 '22 18:08 Stratus3D