How to upgrade rubygems
Install rubygems-update
gem install rubygems-update
update_rubygems
gem update --system
run this commands as root or use sudo.
Is `gem update --system` broken for ruby 2.3?
So, there is an issue. The requirement for ruby newer or equal to 2.3 is a new reality and everyone has to adopt the project to it. E.g. https://github.com/puppetlabs/pdk-templates/pull/171.
TL;DR: gem update --system 2.7.8
updating RubyGems on Ubuntu
Seems like you installed rubygems from Debian/apt-get package.
If you're on Ubuntu 9.04 or later, this might work:
sudo gem install rubygems-update
sudo update_rubygems
Otherwise, remove the package and install rubygems from source, which is the recommended way to install rubygems anyway:
sudo apt-get remove rubygems
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar xzvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update --system
More resources: Ruby on Rails installation on Ubuntu.
Difference between `update_rubygems` and `gem update --system`
gem install rubygems-update; update_rubygems
was needed in some old versions of rubygems, but gem update --system
is all that's needed for the foreseeable future.
rubygems 1.1 and 1.2 had bugs that prevented gem update --system
from working the first time, so you had to use those first two commands to upgrade at all. There would be no reason to run gem update --system
immediately thereafter, because rubygems would already be updated, but doing so would demonstrate that you would be able to run that command in the future.
Versions of rubygems before 1.5.2 did not accept a version argument following gem update --system
, so you had to use the first two commands you give to install an arbitrary version of rubygems. You wouldn't want to run gem update --system
immediately thereafter; it would undo what you'd just done.
More here: https://github.com/rubygems/rubygems/blob/master/UPGRADING.md
Various ways to update Ruby gems
The Gemfile
is what you change to add/remove/update the gems (or just the versions of gems) running in your app. Gemfile.lock
is the file that's automatically updated by bundler. In fact, you shouldn't try to manually update Gemfile.lock
: first, because it's auto-generated, and second it's not intended to be altered by hand, and you're likely to confuse bundler if you alter it yourself.
To answer you list:
bundle install
installs any new/updated gems and dependencies - but if they are already installed, nothing is donebundle update
runs through your installed gems, and grabs the newest, allowed versions, as defined in yourGemfile
gem install my_gem.gem
bypasses bundler, and installs the gem at the system level (i.e. outside your application's code bundle)gem update my_gem.gem
bypasses bundler, and updates the gem at the system level (i.e. outside your application's code bundle)
So, one set of commands installs (if not already installed), one set of command updates to latest versions the gems that are already installed, one set of commands does these things within the scope of your app only (your application code bundle), and one set of commands does these things at the system level.
Git is not relevant to your question here.
heroku upgrade rubygems
No, you can't upgrade Rubygems as such as it's part of the curated platform. You might be able to do something whizzy with the Heroku buildpacks.
To be honest though, I'm not sure that's the actual problem you're suffering from.
https://github.com/carlhuda/bundler/issues/1392
Related Topics
Best Way to Create Custom Config Options For My Rails App
What Exactly Is the Singleton Class in Ruby
How to Find an Item in Array Which Has the Most Occurrences
How to Create a Deep Copy of an Object in Ruby
Is There a "Do ... While" Loop in Ruby
How to Install Postgresql'S Pg Gem on Ubuntu
String Concatenation Vs. Interpolation in Ruby
Pg::Error: Select Distinct, Order by Expressions Must Appear in Select List
Is There an Efficient Way to Perform Hundreds of Text Substitutions in Ruby
Installing Bootstrap 3 on Rails App
What Are the Ruby File.Open Modes and Options
What Does a Double * (Splat) Operator Do
Which Ruby on Rails Is Compatible With Which Ruby Version
How to Validate a Date in Rails