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

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.



Solution 1:[1]

When I execute both , apparent difference is:

  • update_rubygems - update gem to the current update_rubygems version.
  • gem update --system (without version option) - update to latest version.

For example, when the following situations:

  • gem: 3.0.6
  • update_rubygems: 3.2.17
  • latest gem: 3.3.8

then,

$ sudo update_rubygems --no-document
...
$ gem -v
3.2.17

while

$ sudo gem update --system --no-document
...
$ gem -v
3.3.8

That's current result as of today.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fumisky Wells