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

Auto-run `--latest` when `install` doesn't find a version

Open veganstraightedge opened this issue 8 years ago • 4 comments

Expected

When I run ruby-install 2.5.0, I expect ruby 2.5.0 to install.

Actual

Instead, I get !!! Unknown ruby: 2.5.0.

Suggestion

Instead of requiring the user to run ruby-install --latest or ruby-install --latest ruby-2.5.0, I wish that ruby-install would auto-run ruby-install --latest when a version is requested but not found.

veganstraightedge avatar Dec 27 '17 04:12 veganstraightedge

The Ruby engine, like "ruby" or "jruby", is expected before the version. It corresponds with RUBY_ENGINE. You can ruby-install --latest ruby-2.5.0 or ruby-install --latest ruby 2.5.0.

havenwood avatar Dec 27 '17 17:12 havenwood

@havenwood Oh, I'm sorry. I didn't do a good job explaining myself.

I understand how it does work now. (I mistyped my issue above.)

What I'm suggesting / requesting is that when a user tries to install a version of a Ruby that ruby-install doesn't know about yet, then ruby-install should automatically run ruby-install --latest to update its list of known Ruby versions. For example:

ruby-install ruby-2.5.1

Currently: !!! Unknown ruby: 2.5.0 Suggested: ruby-install --latest && ruby-install ruby-2.5.1 gets run.

veganstraightedge avatar Dec 28 '17 09:12 veganstraightedge

Some way of only going online to fetch a new version list if the requested version is unknown would be nice.

donv avatar May 31 '19 08:05 donv

I'll take this on for 0.9.0. Will need to add some messy logic to check the version once, if not found update, then check again, if still not found exit with an error.

postmodern avatar May 02 '22 06:05 postmodern

I added additional logic check in bbc327d80f094a8b24c446ca36da7b60d9579fb8 to also download the version files if the ruby version is not yet known. Will be released in 0.9.0.

postmodern avatar Jan 24 '23 01:01 postmodern