【问题标题】:Unknown ruby interpreter version (do not know how to handle): RUBY_VERSION未知的ruby解释器版本(不知道如何处理):RUBY_VERSION
【发布时间】:2018-04-12 14:28:36
【问题描述】:

尝试rvm use . 以按照说明in here 尝试修复我的混乱配置,我在控制台中收到以下消息:

未知的ruby解释器版本(不知道如何处理):RUBY_VERSION。 无法确定使用哪个 Ruby; .应包含 .rvmrc 或 .versions.conf 或 .ruby-version 或 .rbfu-version 或 .rbenv-version,或 Gemfile 中的适当行。

我猜是指 Gemfile 中的变量 RUBY_VERSION:

source "https://rubygems.org" 
ruby RUBY_VERSION

我该怎么办?我猜RUBY_VERSION 变量必须定义为系统变量?

我只是想用 Jekyll。

额外信息:

现在我有:

  • gem -v2.6.14
  • ruby -v ruby​​ 2.0.0p648(2015-12-16 修订版 53162)[universal.x86_64-darwin15]
  • jekyll -v 失败并出现很长的错误。
  • bundle -v Bundler 版本 1.14.4

【问题讨论】:

  • 尝试将ruby '2.2.0' 添加到您的gemfile(将RUBY_VERSION 替换为实际版本)。当您尝试bundle install 时,请告诉我您会得到什么
  • 我做到了,现在我得到Required ruby-2.2.0 is not installed.,即使使用ruby -v 会返回:ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
  • rvm use 2.2.0 现在 ruby​​ 版本应该是 version 应该设置为那个版本
  • @Cyzanfar 使用rvm use 2.2.0 返回Required ruby-2.2.0 is not installed. To install do: 'rvm install "ruby-2.2.0"'
  • 我在问题中添加了额外信息。

标签: ruby jekyll rvm


【解决方案1】:

RUBY_VERSION 应该是一个特定的版本字符串,例如 '2.4.2'(带引号)。

但是,如果您不特别关心您使用的 Ruby 版本,那么您应该可以删除整行,而 rvm 将使用默认值。

【讨论】:

  • 我都试过了。删除它不起作用,因为它说:Now using system ruby. Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile. Run rvm help`查看使用信息`
  • 并且使用诸如“ruby 2.0.0”之类的数字向我显示:Required ruby-2.2.0 is not installed. etc.... 即使使用ruby -v 返回ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
  • 一些事情要尝试:rvm --default use system 以确保 rvm 具有良好的回退,然后尝试在文件中设置完整的版本字符串,“2.0.0p648”。
  • 两者都完成了,rvm --default use system 我收到消息“现在使用系统 ruby​​”。两次。但什么都没有改变。
  • 使用整个字符串2.0.0p648 并没有改变任何东西,仍然得到Required ruby-2.0.0p648 is not installed. Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile.
猜你喜欢
  • 1970-01-01
  • 2019-09-26
  • 1970-01-01
  • 2022-11-15
  • 2012-10-31
  • 2011-07-03
  • 2017-10-17
  • 2013-05-21
  • 1970-01-01
相关资源
最近更新 更多