Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use RVM and create globally available gems?

I'm running Mac OSX 10.6.4 and have installed RVM. Its been great so far, I really love the way it lets me manage having multiple versions of rails and ruby on the same machine without headaches!

However, I don't want to have to install certain gems (such as passenger) for each setup. Is there a way to share gems between gemsets? I have a [email protected] and 1.9.2@rails3, can I have gems such as passenger, mysql, and capistrano installed once and used with all versions?

like image 719
GiH Avatar asked Oct 24 '10 04:10

GiH


People also ask

Where does RVM store gems?

Show activity on this post. I know that when using gem install , the gem will be stored under /home/username/. rvm/gems/, under which gemset the gem was installed.

What is the use of RVM?

As you can see, RVM is a versatile tool that can be used to manage projects and entire Ruby environments. You can use RVM to configure development conditions, server installations, and even to deploy your application.

How do I publish a gem to RubyGems?

Publishing to RubyGems.orgVisit the sign up page and supply an email address that you control, a handle (username) and a password. After creating the account, use your email and password when pushing the gem. (RubyGems saves the credentials in ~/. gem/credentials for you so you only need to log in once.)


1 Answers

There is something called the global gemset, and it is shared between all your gemsets of a certain ruby-version. But you can't share gems between ruby-versions.

However, what you can do is create a list of gems that will be installed automatically when adding a new ruby version. That is described here. In short: edit a file called ~/.rvm/gemsets/global.gems to contain the list of gems you want to be there for each ruby-version.

Hope it helps.

like image 80
nathanvda Avatar answered Sep 17 '22 01:09

nathanvda