gpt4 book ai didi

ruby - RVM 报告 Gemfile ruby​​ 未安装

转载 作者:数据小太阳 更新时间:2023-10-29 07:27:04 29 4
gpt4 key购买 nike

在我的 Gemfile 中,我指定了:

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

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

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:

$ 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 工作正常。

Gemfile中的ruby指令是否有问题?

我关注了 official specification ,其中有一个非常相似的例子。


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

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'

最佳答案

根据 this所以回答:

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


通过添加:

#ruby=jruby-1.7.9

ruby 指令下方的 Gemfile,rvm 似乎能够选择正确的 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]

关于ruby - RVM 报告 Gemfile ruby​​ 未安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20943906/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com