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

Omitting ruby version makes ruby-install exit successfully

Open p-mongo opened this issue 6 years ago • 1 comments

I ran the following command:

ruby-install -c -j2 --no-install-deps -r /data/rubies --patch 1.9.3-p551.diff -- --disable-install-doc

What I meant to run was the following:

ruby-install -c -j2 --no-install-deps -r /data/rubies --patch 1.9.3-p551.diff 1.9.3-p551 -- --disable-install-doc

ruby-install silently ignored all of the command line arguments and told me what the current versions of various ruby implementations were. As this was in a script I was momentarily confused why later in the run I had no ruby 1.9 despite giving set -e everywhere.

Perhaps ruby-install should fail with an error if it is given options but no ruby version to install.

p-mongo avatar Jul 24 '18 02:07 p-mongo

Two separate bugs here.

  1. ruby-install -c -j2 --no-install-deps -r /data/rubies --patch 1.9.3-p551.diff -- --disable-install-doc: since you didn't specify a ruby/version, parse_options assumes you want to list available ruby versions, since ruby-install is a valid invocation. So maybe only list rubies if there are absolutely zero arguments given?
  2. ruby-install -c -j2 --no-install-deps -r /data/rubies --patch 1.9.3-p551.diff 1.9.3-p551 -- --disable-install-doc: causes parse_ruby to incorrectly try to parse 1.9.3-p551 as ruby-version format. parse_ruby could obviously be a little smarter...

postmodern avatar Oct 10 '20 05:10 postmodern