How can I generate older rails application when current version is 3.0.3
I have 2 different Rails Rubygems installed on my Linux开发者_运维知识库 OS [2.3.8 and 3.0.3], but the current active Rails version is 3.0.3. So is it possible to generate Rails app using 2.3.8 style generator:rails testapp
not new one: rails new testapp
?
You can tell Rails to use version 2.3.8
like this:
rails _2.3.8_ testapp
I'd recommend installing RVM and setting up different gemsets for each version of Rails. That way you can easily switch between Rails versions by just switching gemsets.
See here: How to use the Rails 2.3 app generator when I have Rails 3 installed?
Quoting Leonid Shevtsov:
The easiest way to do it was:
- Create the directory for the project
- Create a Gemfile there containing
gem "rails", "2.3.9"
gem "sqlite3-ruby", :require => "sqlite3"- Run "bundle install"
- Run "bundle exec rails ." to create an app in the current path You don't even need rvm to do this.
You could also use rvm.
精彩评论