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 OverflowWhat's the difference between gem update and gem update --system?
Can anyone explain how to update rubygems on an old version of ruby
how to update a gem?
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.comVideos
Does gem update include the gems that get updated with the --system flag?
Do these commands update the same location (system or user gem path)?
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.