sbs
sbs

Reputation: 4152

Best way to upgrade to Ruby 2.3 through rvm while keeping all your gems?

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)?

Upvotes: 7

Views: 12877

Answers (1)

user513951
user513951

Reputation: 13715

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.

Upvotes: 23

Related Questions