How to install RubyGems:

RubyGems is the package manager for Ruby. Download the latest version here:

To upgrade to the latest RubyGems (Ruby 3.1+ comes with a recent version already):

$ gem update --system
Note: You may need administrator/root privileges.

Important: If you have an older Ruby version, or issues updating, you can manually update RubyGems:

$ gem install rubygems-update
$ update_rubygems

If you don't have RubyGems installed at all, you can manually set it up:

  1. Download the latest version from the links above.
  2. Extract the archive and cd into the directory.
  3. Run ruby setup.rb (may require admin/root privileges).

Note: RubyGems is bundled by default with Ruby 2.5 and higher (including 3.1+), so manual installation is rarely necessary.