I'm having a problem or would like to suggest a feature.
My current problem is that I have projects using travis-ci to test them under ruby 2.2.
The command gem update --system broken after rubygems 3.0.0 being released.
https://github.com/rubygems/rubygems/blob/297c725d5051135f4a7ab6425c5a5dd8e34287d5/History.txt#L3
The error messages:
gem update --system
Updating rubygems-update
ERROR: Error installing rubygems-update:
rubygems-update requires Ruby version >= 2.3.0.
ERROR: While executing gem ... (NoMethodError)
undefined method `version' for nil:NilClass
The command "gem update --system" failed and exited with 1 during .
Your build has been stopped.
I would like to known how to update rubygems to the latest compatible version without throwing errors?
This issue is related to:
gemHere are my current environment details:
$ ruby --version
ruby 2.2.7p470 (2017-03-28 revision 58194) [x86_64-linux]
$ rvm --version
rvm 1.29.3 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
$ bundle --version
Bundler version 1.16.0
$ gem env version
2.6.11
I will abide by the code of conduct.
would like to known how to update rubygems to the latest compatible version without throwing errors?
I hit the same problem and worked around like this. https://github.com/colszowka/simplecov/commit/ba423820d1d1164fcc038e7b6163b8a96d1786be
RubyGems 3.0.0 is only installable on Ruby >= 2.3
For 2.2 & 2.2.10, try
- gem install "rubygems-update:<3.0.0" --no-document
- update_rubygems
At present, RubyGems does not correctly handle Ruby version constraints.
EDIT: Windows type, not a bash type. For all Ruby versions, try:
gem update --system --conservative || (gem i "rubygems-update:~>2.7" --no-document && update_rubygems)
gem update bundler --conservative
It does waste a bit of time downloading 3.0.0 when used on Ruby 2.2, but it still installs 2.7.8...
Please use solutions of @amatsuda or @MSP-Greg.
Most helpful comment
RubyGems 3.0.0 is only installable on Ruby >= 2.3
For 2.2 & 2.2.10, try
At present, RubyGems does not correctly handle Ruby version constraints.
EDIT: Windows type, not a bash type. For all Ruby versions, try:
It does waste a bit of time downloading 3.0.0 when used on Ruby 2.2, but it still installs 2.7.8...