rvm Gemsets

Lets say that you have two different Rails app. Now these apps would require certain types of gems, and some times these gem requirements could clash with each other. If that happens its better to use a thing called gem sets.

To know about gem sets take a look at this picture.

rvm_gemset

At the bottom you see the mighty rvm upon which can sit many Ruby installations, these installations can be switched using the rvm use <Ruby_version_number> , but lets say that you have two Ruby applications and for some strange reason you want to use one with older version of gems with one and another needs to use newer set of gems. You may want to  use different set of gems for an application, how to do that?

Well rvm has a thing called gemset with which you can group a set of gems under a name under a particular version of Ruby. This means as shown in the diagram above, note the green  boxes above Ruby 1.8 and 1.9 , you can have nnumber of gems ranginging from g1 to gn. You can name these gemsets any name you wish so that its quiet user friendly to change.

in the future if you think your Ruby / Rails / Sinatra or any other application is faltering due to  wrong gems installed, create a new gem set for it, switch it using rvm gemset commands and hope all things will go right. I am not going to dive deep into it as the rvm gemset has a good documentation here.

Advertisements

, , , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: