Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between `update_rubygems` and `gem update --system`

Tags:

ruby

rubygems

What is the difference between this command:

gem update --system

And these commands:

gem install rubygems-update
update_rubygems
gem update --system

I would've assumed that the former would be all that is required in order to update to the latest version of RubyGems, but I have found many references (including https://stackoverflow.com/a/13626200/1369417) which recommend the latter.

like image 643
Joshua Spence Avatar asked May 10 '16 21:05

Joshua Spence


1 Answers

gem install rubygems-update; update_rubygems was needed in some old versions of rubygems, but gem update --system is all that's needed for the foreseeable future.

rubygems 1.1 and 1.2 had bugs that prevented gem update --system from working the first time, so you had to use those first two commands to upgrade at all. There would be no reason to run gem update --system immediately thereafter, because rubygems would already be updated, but doing so would demonstrate that you would be able to run that command in the future.

Versions of rubygems before 1.5.2 did not accept a version argument following gem update --system, so you had to use the first two commands you give to install an arbitrary version of rubygems. You wouldn't want to run gem update --system immediately thereafter; it would undo what you'd just done.

More here: https://github.com/rubygems/rubygems/blob/master/UPGRADING.md

like image 138
Dave Schweisguth Avatar answered Oct 20 '22 10:10

Dave Schweisguth