views:

26

answers:

2

So I want to create environments for rails 3 and rails 2.1.1

How do I do this?

Where do I look for the various versions of rails?

I get an error when I try:

rvm 1.9.2-head
ruby ruby-1.9.2-head is not installed.

I just followed what I read on: http://rvm.beginrescueend.com/gemsets/creating/

A: 

Rvm is for different versions of Ruby not rails. You can potentially have every version of rails installed on one version of ruby. The application itself will in it's Gemfile or config specify what version of rails you are using.

Trip
but when I create and use a new gemset, I have to install rails correct?
Blankman
+1  A: 

Yes, gemsets are ideal for this. I use gemsets for this too. First you have to create the gemset:

rvm gemset create your-project-name

then use the gemset:

rvm gemset use your-project-name   

When you do this, all your gems are unreachable, you can get them back by using rvm gemset use, which will return to the default gemset (unnamed).

Inside your gemset, you will have to reinstall all needed gems. If you are using bundler, it is as simple as

bundle install

The advantage of using gemsets is that your gems are cleanly seperated. For instance, i ran into trouble with spec/rspec scripts when using both rails2 and rails3 together. With gemsets i no longer have any problems. Using an .rvmrc file per project, even the selection of the correct gemset is automatic, and i can configure my project in rubymine to use the correct gemset too. Awesome :)

nathanvda