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:
Note: RubyGems is bundled by default with Ruby 2.5 and higher (including 3.1+), so manual installation is rarely necessary.