Install rubygems-update

gem install rubygems-update
update_rubygems
gem update --system

run this commands as root or use sudo.

Answer from Sacx on Stack Overflow
🌐
GitHub
gist.github.com › larsthegeek › 4029012
Update RubyGems to a specific version (for legacy system installs) · GitHub
gem update --system 2.7.8 · Copy link · Copy Markdown · For Ruby 2.7: gem update --system 3.4.22 · Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment ·
Discussions

What's the difference between gem update and gem update --system?
gem update --system upgrades rubygems itself whereas gem update upgrades all gems including both user-installed ones and default ones but not rubygems. The --system flag cuts off execution of the regular update command. You can think of gem update --system as "upgrade rubygems". More on reddit.com
🌐 r/ruby
2
5
March 22, 2022
Can anyone explain how to update rubygems on an old version of ruby
Did you copy the original bundled dependencies by accident somehow? That would be my first guess at bizarre errors and segfaults. I don't see the Rubygem version being the culprit at this point. That said, are you able to use Docker? To be honest, as noble as it is to get this working without Docker, this is exactly where Docker would shine. Incrementally start changing the tags of the Docker image as you correct deprecations amongst versions. If you wanted to abandon Docker once you were up to date, that would probably be fine, but using it as an intermediary would possibly work better for you. More on reddit.com
🌐 r/ruby
3
0
January 17, 2024
how to update a gem?
So bundler is ment to update gem's a an categorize them? Is that its only purpose? Is bundler used in combination with rail? ... Correct, bundler is used in combination with rails. Rails is technically a gem too. Bundler can be used in Rails, Sinatra, RubyGems, Rubymotion. More on teamtreehouse.com
🌐 teamtreehouse.com
3
November 4, 2015
Updating default gems

Normally multiple versions of a gem wouldn't matter as bundler would sort this out, but default gems are treated differently and this often results in both versions of the same gem being loaded twice, regardless of Gemfile, and depending on how other gems in the bundle require the default gems.

Can you say more about this? I didn't know it was possible for multiple versions of the same gem to ever be loaded simulataneously, default or not.

So I guess the answer is... I don't handle this specially, because I was not aware of the problem you are talking about. So I just do what you describe, and figured it was fine -- I thought the version in the Gemfile would always be used (if using bundler), or the latest version in the system (if not using bundler, but I pretty much always use bundler).

More on reddit.com
🌐 r/ruby
4
7
November 7, 2019
🌐
Sourabh Bajaj
sourabhbajaj.com › mac-setup › Ruby › RubyGems.html
RubyGems · macOS Setup Guide
Verify this by running: which gem · To update to its latest version with: gem update --system · To install a gem (Ruby package), run: gem install <gemname> To install without generating the documentation for each gem (faster): gem install <gemname> --no-document ·
🌐
RubyGems
guides.rubygems.org › command-reference
Command Reference - RubyGems Guides
Editor command can be specified with -e option, otherwise rubygems will look for editor in $EDITOR, $VISUAL and $GEM_EDITOR variables. ... The outdated command lists gems you may wish to upgrade to a newer version. You can check for dependency mismatches using the dependency command and update the gems with the update or install commands.
🌐
Moncef Belyamani
moncefbelyamani.com › how-to-update-gems-in-your-gemfile
How to Update Gems in Your Gemfile
March 26, 2022 - They often introduce breaking changes when the second digit changes, such as going from Rails 6.0.x to 6.1.x. If something breaks when you update a gem, and you don’t have time to figure out how to make it work with the latest version, go back to the previous version and specify 3 digits. It’s important to note that just because you specify a newer version number doesn’t necessarily mean it can be installed. Most gems in your Gemfile will also depend on other gems. If you go back to the Jekyll page in Rubygems, you will see all the gems it depends on under “Runtime Dependencies”. This means that when you install Jekyll, you are also installing a bunch of other gems, and the gems that they depend on, and so on.
🌐
RubyGems
rubygems.org › gems › rubygems-update › versions
All versions of rubygems-update | RubyGems.org | your community gem host
RubyGems.org is the Ruby community’s gem hosting service. Instantly publish your gems and then install them. Use the API to find out more about available gems. Become a contributor and improve the site yourself · The RubyGems.org website and service are maintained and operated by Ruby ...
Find elsewhere
🌐
FastRuby
fastruby.io › blog › step-by-step-ruby-upgrade.html
A Step-by-Step Guide to Upgrading Your Ruby Version - FastRuby.io | Rails Upgrade Service
March 13, 2025 - Update Ruby Version: Locate any files that specify the current Ruby version and update them. Examples of these files can be .ruby-version, Gemfile, build files and Docker if you have them.
🌐
RubyGems.org
rubygems.org › pages › download
Download RubyGems | RubyGems.org | your community gem host
RubyGems is a package management framework for Ruby. Upgrade to the latest RubyGems at the command line: $ gem update --system · If you run into problems that prevent you from upgrading rubygems the standard way, you can try upgrading manually: Download the latest version ·
🌐
RVM
rvm.io › rubies › upgrading
RVM: Ruby Version Manager - Upgrading RVM.
Upgrades the specified (already installed) source ruby given to the given destination ruby version. Will migrate gemsets, wrappers, aliases and environment files.
🌐
Mo, Lingbo
molingbo.github.io › rubygems-3.2.29 › UPGRADING
How to upgrade/downgrade Rubygems: - Mo, Lingbo (莫凌波)
Do make sure that you don’t have any other versions of rubygems-update installed when you run the second command. ... $ ruby --disable-gems -S gem which rubygems ~/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb $ rm ~/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems.rb $ rm -rf ~/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems $ gem -v 1.3.7
🌐
Bundler
bundler.io › guides › updating_gems.html
Bundler: How to update gems with Bundler
The rack-cache gem depends on rack >= 0.4. Let’s assume that the rails 3.0.0 final gem also depends on rack ~> 1.2.1, and that since the release of rails 3.0.0, the Rack team released rack 1.2.2. If we naïvely update all of our gems in order to update Rails, we’ll get rack 1.2.2, which satisfies the requirements of both rails 3.0.0 and rack-cache.
🌐
Reddit
reddit.com › r/ruby › can anyone explain how to update rubygems on an old version of ruby
r/ruby on Reddit: Can anyone explain how to update rubygems on an old version of ruby
January 17, 2024 -

I need to get some old software working so I can flood it with tests and then start the process of updating it to modern versions of everything.

This means that I need to be working with some old versions of things temporarliy.

What I am fundamentally trying to do is just run "bundle install" on an old rails app.

But that gives a "Marshal.load reentered at marshal_load" error.

Lookat at the differenc in versions between an old working dev box and the new new box, the only obvious thing is that rubygems is at 3.0.9 on the old working box and 2.4.5.5 on the new box I'm trying to setup.

State of play:

I am using rbenv on a Chromebook under Crostini i.e. Debian 10 buster.

I have got ruby 2.2.10 installed successfully (which was fun)

"gem --version" gives me 2.4.5.5

I am trying to get rubygems up to 3.0.9, to match the old dev box which is known to work.

So my question is, how do I update rubygems 2.4.5.5 to 3.0.9, ideally within the rbenv setup?

"gem update --system" just segfaults.

What are my other options?

(FYI, I have a plethora of rubies installed on the new box using rbenv, and the newer rubies do indeed have newer rubygems, eg. the ruby 3.1.2 has rubygems 3.3.7 etc.)

(FYI2, the old box uses RVM, new new box is using rbenv.)

EDIT:- Ok, reading this back, the core issue is how to stop "bundle install" exploding, the rubygems thing was just a guess.

🌐
Mac Install Guide
mac.install.guide › ruby › 7
Update Gems for Ruby · Mac Install Guide
December 26, 2021 - You can check if a newer RubyGems version is available. Use gem update --system to upgrade the Ruby gem manager if your version is old:
🌐
RubyGems
guides.rubygems.org › updating_gems
How to update gems with Bundler - RubyGems Guides
The rack-cache gem depends on rack >= 0.4. Let’s assume that the rails 3.0.0 final gem also depends on rack ~> 1.2.1, and that since the release of rails 3.0.0, the Rack team released rack 1.2.2. If we naïvely update all of our gems in order to update Rails, we’ll get rack 1.2.2, which satisfies the requirements of both rails 3.0.0 and rack-cache.
🌐
Delft Stack
delftstack.com › home › howto › ruby › update ruby gems
How to Update Ruby Gems | Delft Stack
February 26, 2025 - This command checks for the latest version of RubyGems and updates it to that version. It’s a good practice to run this command periodically, especially if you’re working on projects that rely on specific gem versions.
🌐
DEV Community
dev.to › michymono77 › how-to-keep-your-ruby-gems-up-to-date-without-the-stress-2ikf
Practical Steps: How to Strategically Update Your Ruby Gems - DEV Community
January 12, 2025 - Keep in mind that replacing a gem can be time-intensive, particularly if it is deeply integrated into your codebase. It may require substantial code changes and adaptation. Updating Ruby gems is crucial for keeping your app secure and efficient, but it can sometimes be tricky.
🌐
FastRuby
fastruby.io › blog › how-to-make-your-gem-compatible-with-next-ruby-rails.html
How to Upgrade Your Internal Gem for Compatibility With the Next Ruby/Rails Version - FastRuby.io | Rails Upgrade Service
June 18, 2024 - Check for updates: Look at the dependency’s Changelog or repository history to determine if there is a newer version that supports your desired Rails/Ruby version. Update the dependency version: If there is a compatible version, update the version specified in your gem’s .gemspec file.
🌐
Team Treehouse
teamtreehouse.com › community › how-to-update-a-gem
how to update a gem? (Example) | Treehouse Community
November 4, 2015 - And so bundler's job is to download, install, update, and otherwise manage other gems. Bundler would even manage the rails gem. Here is a good source to look for gems https://rubygems.org/