Reputation: 479
I want to create a new rails app in 3.0.10 but the latest rails in my machine is 3.1.3. If I run:
gem list rails
Then I get the following output:
*** LOCAL GEMS ***
rails (3.1.3, 3.0.11, 3.0.10, 3.0.9, 3.0.7, 3.0.6, 3.0.4.rc1)
rails3-jquery-autocomplete (1.0.5)
Now I have applications in both 3.1 and 3.0 so I don't want to remove 3.1. How can I create this new rails app in 3.0.10?
Upvotes: 17
Views: 4442
Reputation: 12455
To create a rails application for a specific version you can use this syntax:
$rails _3.0.10_ new appname
NOTE: The underscores are needed.
Upvotes: 29
Reputation: 9952
You should definitely use RVM (ruby version manager), to use different versions of rails can be reached easily:
rvm gemset create rails3
rvm gemset create rails3.2
rvm gemset create rails3.1
then, to you should use on of them to create rails project
rvm gemset use rails3 && gem install rails -v 3.0.10
rvm gemset use rails3.2 && gem install rails -v 3.2.2
rvm gemset use rails3.1 && gem install rails -v 3.1
Upvotes: 3