What's the best way to upgrade to Ruby 2.3 through rvm
while keeping all your gems installed on previous version (e.g. json
, nokogiri
, etc)?
Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.
EDIT
This question has an answer here: RVM: How to use gems from a different ruby?
$ rvm gemset copy $oldversion 2.3.0 ## Assign or replace $oldversion with old version name
ORIGINAL
Before installing Ruby 2.3, get a list of your installed gems and their versions using gem list
. Then, after you install Ruby 2.3, use rvm
to set 2.3 as the new default:
$ rvm install 2.3.0
$ rvm --default use 2.3.0
If you use Bundler, gem install bundler
and then bundle install
in all your project directories. This should install all of the gems relevant to your work.
If you don't use Bundler, or if you have gems installed that aren't part of any project's Gemfile
, then you will want to go through the list of gems and their versions that you made earlier and gem install
each of them, using -v
to specify the version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With