Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create previous version rails in rails 3?

I've just upgraded my rails version to rails 3.0. But suddenly I need a new rails app with old version of rails. I know the new version of rails change command line usage with rails new. How can I create an old version of Rails in this new Rails 3 environment?

like image 546
john Avatar asked Sep 22 '10 18:09

john


People also ask

How do I use different versions of rails?

Normally you should be able to choose different gemsets and have there a specific ruby version. In the past I created always a clean an fresh new gemset for a new project..so first create a gemset, second choose the new gemset, third install the newest rails, fourth use it :-). Should work..

How do I change the rails version in Rbenv?

By using the "RBENV_VERSION=1.9. 2-p290" prefix in your command line, you're specifying which ruby rbenv should be concerned with. Then following that with the "rbenv exec" command, you can install rails. Just use the version flag as in the example to specify which version you want.


2 Answers

Use the following command:

rails _2.3.5_ new APP_NAME

This will create a rails project with version 2.3.5

like image 175
Gautam Rege Avatar answered Sep 23 '22 17:09

Gautam Rege


Leonid Shevtsov provided instructions for how to do this here.

The easiest way to do it was:

  1. Create the directory for the project

  2. Create a Gemfile there containing

    gem "rails", "2.3.9"

    gem "sqlite3-ruby", :require => "sqlite3"

  3. Runbundle install

  4. Run bundle exec rails . to create an app in the current path

You don't even need rvm to do this.

like image 41
vonconrad Avatar answered Sep 24 '22 17:09

vonconrad