Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RVM: How to use gems from a different ruby?

Tags:

ruby

rvm

I have been using RVM to manage my Rubies and gems.

When I first installed RVM, the Ruby version that I installed was 1.9.2-p0. I recently installed Ruby 1.9.2-p136, which created a new Ruby in the RVM.

My problem is I want to use the latest version of Ruby but all of the gems I installed were installed under the 1.9.2-p0 directory, because RVM keeps gems completely separate between Rubies, and I want to be able to use those gems with my new version, p-136 without having to reinstall them all.

Is there a way I can get my gems from my p-0 Ruby to work with my p-136 Ruby?

like image 755
ab217 Avatar asked Feb 13 '11 06:02

ab217


1 Answers

You can use copy in rvm

$ rvm gemset copy 1.9.2-p0 1.9.2-p136

See more about the rvm copy command

This is the fastest way to get your gems moved over and it wont reinstall everything, just copy them over. But once you've got that squared away I'd do as the others are suggesting and start using gemsets. It's a nice way to group the gems you use in your projects.

like image 172
Dty Avatar answered Sep 17 '22 04:09

Dty