如何为项目设置默认 rails 版本? [英] How to set default rails version for a project?
问题描述
我在我的系统 (Fedora) 中安装了两个不同的 Rails 版本.
I have installed two different rails versions in my system (Fedora).
gem list -d rails
*** LOCAL GEMS ***
rails (3.0.5, 1.2.1)
Author: David Heinemeier Hansson
Rubyforge: http://rubyforge.org/projects/rails
Homepage: http://www.rubyonrails.org
Installed at (3.0.5): /usr/local/lib/ruby/gems/1.8
(1.2.1): /usr/local/lib/ruby/gems/1.8
Full-stack web application framework.
当我尝试按照以下方式创建项目时 ("http://www.nomachetejuggling.com/2008/03/12/using-multiple-versions-of-rails/")
When i try to create the project like following way ("http://www.nomachetejuggling.com/2008/03/12/using-multiple-versions-of-rails/")
rails 1.2.1 myproject
但是,它不起作用.所以,我检查了
But, it's not working. So, i checked
rails -v
Rails 3.0.5
那么,你能帮我看看如何用旧版本和新版本创建项目吗?有没有办法将特定的 Rails 版本设置为默认版本?
So, can you help me, how to create the project with older version and newer version. Is there any way to set the particular rails version as default?
推荐答案
要使用比您安装的最新版本旧的版本,只需将版本号用下划线括起来:
To use an older version than the latest you have installed, just wrap the version number in underscores:
rails _1.2.1_ myproject
这篇关于如何为项目设置默认 rails 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!