How to use Rails2 when Rails3 is installed

2019-06-08 03:59发布

Hello I have both Rails2 and Rails3(beta 3) installed by Ruby Gems. Everything right now defaults to using Rails3. For instance rails myproject will create a new Rails3 template. How do I override this so everything goes to Rails2?

2条回答
手持菜刀,她持情操
2楼-- · 2019-06-08 04:18

I have been using RVM which allows you to run multiple of Ruby with isolation for sets of gems and other configuration. Really useful for testing and managing multiple versions of Rails.

查看更多
倾城 Initia
3楼-- · 2019-06-08 04:37

Ok, after some googling, stumbled upon this article: http://www.nomachetejuggling.com/2008/03/12/using-multiple-versions-of-rails/

Just tested it and it works. I just get my exact version of Ruby on Rails, which is 2.3.5 and run rails like so:

rails _2.3.5_ myproject
查看更多
登录 后发表回答