如何为项目设置默认 rails 版本? [英] How to set default rails version for a project?

查看:39
本文介绍了如何为项目设置默认 rails 版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的系统 (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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆