How to Move your Rubygems from one Ruby version to another in RVM

Today’s post is going to be a pretty short one.

So you know how sometimes when requirements change and your entire project have to change (either to upgrade or to downgrade) from one Ruby version to another, you don’t want to have to reinstall and setup your gems all over again?

Here’s a quick little tip to quickly move your gems from one version to another.

Assuming that you’re currently using Ruby 2.1.3 and you’re trying to downgrade to 2.1.2.

With your 2.1.2 environment already installed, just do the following:

  $ rvm gemset copy 2.1.3 2.1.2

There, you don’t need to go through the whole bundle process all over again and its much faster as it just copies the gems over.