简体   繁体   English

Ruby的RVM版本与Ruby -v不同

[英]RVM version of Ruby is different from Ruby -v

I'm trying to install the paperclip gem but I'm being prompted that it requires Ruby version >=1.9.2 我正在尝试安装回形针gem,但系统提示我它需要Ruby版本> = 1.9.2

When I check my version on RVM , I get 1.9.3, Whereas when I check it via the ruby -v command, I get 1.8.7 How do I get my rails application to use the latest version of RUby instead? 当我在RVM上检查我的版本时,我得到1.9.3,而当我通过ruby -v命令检查它时,我得到1.8.7。如何使我的rails应用程序代替使用最新版本的RUby?

@ubuntu:~$ rvm list

rvm rubies

=* ruby-1.9.3-p194 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

@ubuntu:~$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

As a basic step you can set the default ruby rvm is to use as follows. 作为一个基本步骤,您可以设置默认的ruby rvm使用如下。

$ rvm use 1.9.3 --default

You can also set it at the project level by adding an .rvmrc file with the following contents to your project root directory. 您还可以通过在项目根目录中添加具有以下内容的.rvmrc文件,在项目级别进行设置。 You should commit this to the repo. 您应该将此提交到仓库。

rvm 1.9.3

As a final measure, you should stop using rvm and switch to rbenv . 作为最后的措施,您应该停止使用rvm并切换到rbenv It's much better, and we need to stop overriding cd. 这要好得多,我们需要停止覆盖cd。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM