开发者

How can I generate older rails application when current version is 3.0.3

开发者 https://www.devze.com 2023-01-29 02:35 出处:网络
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

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:

  1. Create the directory for the project
  2. Create a Gemfile there containing
    gem "rails", "2.3.9"
    gem "sqlite3-ruby", :require => "sqlite3"
  3. Run "bundle install"
  4. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消