RVM报告未安装Gemfile红宝石 [英] RVM reports Gemfile ruby as not installed

查看:87
本文介绍了RVM报告未安装Gemfile红宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Gemfile中,我已指定:

In my Gemfile, I have specified:

ruby '1.9.3', engine: 'jruby', engine_version: '1.7.9'

但是进入我的Rails项目目录会使rvm抛出此错误:

But entering my Rails project directory makes rvm throw up this error:

RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /home/petey/rails/kotoba/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

ruby-1.9.3,engine:jruby,engine_version:1.7.9 is not installed.
To install do: 'rvm install ruby-1.9.3,engine:jruby,engine_version:1.7.9'

但是,我确实安装了jruby 1.7.9:

However, I do have jruby 1.7.9 installed:

$ rvm list

rvm rubies

   jruby-1.7.9 [ x86_64 ]
   ruby-1.9.3-p392 [ x86_64 ]
=* ruby-2.0.0-p247 [ x86_64 ]

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

$ rvm use jruby
Using /home/petey/.rvm/gems/jruby-1.7.9

$ ruby -v
jruby 1.7.9 (1.9.3p392) 2013-12-06 87b108a on OpenJDK 64-Bit Server VM 1.7.0_25-b30 [linux-amd64]

事实上,我什至可以用rvm use jruby选择它,并且rails可以正常工作.

In fact, I can even select it with rvm use jruby and rails works fine.

Gemfile中的ruby指令是否存在问题?

Is there a problem with the ruby directive in the Gemfile?

我遵循官方规范,该示例具有非常相似的示例.

I followed the official specification, which has a very similar example.

编辑:在提示符下运行rvm install ruby-1.9.3,engine:jruby,engine_version:1.7.9时,rvm继续安装ruby-1.9.3-p484.再次,它在输入项目目录时显示相同的错误消息:

On running rvm install ruby-1.9.3,engine:jruby,engine_version:1.7.9 at the prompt, rvm proceeds to install ruby-1.9.3-p484. And once again, it shows the same error message on entering the project directory:

RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /home/petey/rails/kotoba/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

ruby-1.9.3,engine:jruby,engine_version:1.7.9 is not installed.
To install do: 'rvm install ruby-1.9.3,engine:jruby,engine_version:1.7.9'

推荐答案

根据答案:

RVM对ruby指令的支持有限,您可以使用注释来覆盖RVM将使用的内容.

RVM has limited support of the ruby directive, you can use comment to overwrite what will be used by RVM.


通过添加:


By adding:

#ruby=jruby-1.7.9

ruby指令下方的Gemfile中,rvm似乎能够选择正确的红宝石:

to the Gemfile just below the ruby directive, rvm seems to be able to pick the right ruby:

$ cd kotoba
RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /home/petey/rails/kotoba/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

$ ruby -v
jruby 1.7.9 (1.9.3p392) 2013-12-06 87b108a on OpenJDK 64-Bit Server VM 1.7.0_25-b30 [linux-amd64]

这篇关于RVM报告未安装Gemfile红宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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