Question

I'd like to play around with rails 3, but I'm still used to rails 2.3.8 so I have them both installed. Wanting to make a quick rails app to demonstrate how a plugin works, I want to run the command rails test_app but since I have rails 3 installed, I have to run rails new test_app but that will generate a rails 3 app. Is there a way around this while having rails 3 installed?

Was it helpful?

Solution

I think what you are looking for is:

rails _2.1.0_ projectname

Inside that project all the old script/server, script/generate stuff is there for you.

OTHER TIPS

This is a perfect example of what rvm's gemsets can do for you.

In a nutshell (after installing rvm):

% rvm gemset create rails2
% rvm gemset use rails2
% gem install rails -v=2.3.8

Now your current rails is Rails 2!

Whenever you wish to use Rails 2 instead of Rails 3, do:

% rvm gemset use rails2

This will remain in effect for the current terminal/shell session. You can also switch back:

% rvm default

Of course you can also do the exact opposite and create a rails3 gemset to play around with Rails 3, and leave Rails 2 installed as the default.

(Apart from having gemsets, rvm lets you install multiple versions of Ruby on the same system, allowing you to switch between different versions with a simple rvm 1.9.2 or rvm 1.8.7.)

use rvm http://rvm.io/

you can use different/multiple ruby version and have different gemsets for each :) enjoy!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top