我如何“强制"使用我的Rails 3应用程序使用1.9.2 [英] How do I "force" my Rails 3 app to use 1.9.2

查看:100
本文介绍了我如何“强制"使用我的Rails 3应用程序使用1.9.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Rails 3.0.3,并在rvm中安装了Ruby 1.9.2,并将rvm设置为默认使用1.9.2.

I have setup Rails 3.0.3 and installed Ruby 1.9.2 with rvm and set rvm to use 1.9.2 by default.

但是,当我创建一个新的Rails应用并检查环境变量时,它仍然反映了ruby 1.8.7,如何将其更新为1.9.2?

However, when I create a new rails app and check the environmental variables it still reflects ruby 1.8.7, how do I update this to 1.9.2?

推荐答案

您可能正在执行一个旧的1.8.7 rails二进制文件,该文件首先在您的

You are probably executing an old 1.8.7 rails binary that is being found first in your UNIX search path.

您可以在命令行中键入which rails来查看您正在运行的Rails可执行文件.在我的机器上,我得到:

You can type which rails at the command line to see which rails executable you are running. On my machine I get:

/Users/scott/.rvm/gems/ruby-1.9.2-p136/bin/rails

您还可以通过键入echo $PATH

如果您从which rails获得的结果类似于:

If you get a result from which rails that looks something like:

/blah/blah/gems/ruby-1.8.7/bin/rails

...那么您需要从路径中删除旧的rails二进制文件,或使用旧的1.8.7红宝石卸载rails gem,以便找不到并执行它们.

... then you need to remove the old rails binary from your path, or use the old 1.8.7 ruby to uninstall the rails gems, so that they are not found and executed.

完成此操作后,下次尝试执行rails s时,应执行1.9.2版本的rails二进制文件.

Once you have done this, the next time you try to execute rails s, the 1.9.2 version of the rails binary should be executed.

这篇关于我如何“强制"使用我的Rails 3应用程序使用1.9.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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