【问题标题】:ERROR: RVM Ruby not used, run `rvm use 1.9.1` first错误:未使用 RVM Ruby,首先运行 `rvm use 1.9.1`
【发布时间】:2013-08-27 04:08:33
【问题描述】:

我使用的是 Ubuntu 12.04 并使用 rvm 安装了 ruby​​。我最近将 ruby​​ 从 1.9.3 升级到了 2.0.0。当我显示 ruby​​ 版本时,它显示 2.0.0。

$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

当我尝试启动 solr 服务器时,它说缺少一个包。

$ RAILS_ENV=development rake sunspot:solr:start
Could not find unicode_utils-1.4.0 in any of the sources
Run `bundle install` to install missing gems.

然后当我尝试bundle install 时,我收到以下错误。

$ bundle install
ERROR: RVM Ruby not used, run `rvm use 1.9.1` first.

列出已知的红宝石,我正在获取以下 MRI 红宝石。

$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-p374]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p320]
[ruby-]1.9.3[-p448]
[ruby-]2.0.0-p195
[ruby-]2.0.0[-p247]
[ruby-]2.0.0-head
ruby-head

正如我之前所说,我最近将 ruby​​ 更新到 2.0.0 并删除了所有其他的。之后,每次我重新启动计算机时,我都需要执行bundle install 或执行其他先决条件来启动服务器。我确定捆绑包已安装,但某些 rvm ruby​​ 版本是原因。任何帮助将不胜感激。

编辑1:我试过rvm use 2.0.0-p247,下面是我得到的输出。

$ rvm use 2.0.0-p247

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

当bundle install

时,我仍然遇到同样的错误

【问题讨论】:

  • @RajarshiDas : 我试过了,请看编辑 1
  • 对不起忽略我的第一个它应该是rvm use 2.0.0-p195 按照rvm list 然后开始bundle install..请让我知道
  • @RajarshiDas 我设置了Run command as login shell,一切正常。谢谢你给我指路。

标签: ruby-on-rails ruby ubuntu rvm


【解决方案1】:

对于Ruby 2.0.0 它应该是 rvm use 2.0.0-p195 根据你的 rvm list 然后开始 bundle install..
有时也需要运行/bin/bash --login

【讨论】:

    【解决方案2】:

    我在终端首选项中设置了Run command as a login shell 并重新启动了终端。现在一切正常,solr 服务器启动,rails server 工作正常。

    感谢大家的帮助。

    【讨论】:

      【解决方案3】:

      我遇到了同样的错误,原来我没有安装 bundler。在我这样做之后,我没有收到 rvm 错误。

      所以请确保你已经安装了 bundler。

      【讨论】:

        【解决方案4】:

        我在 Ubuntu 14.04 上遇到了与问题标题相同的错误。

        不过,Atlassian 上的这个 wiki 页面对我进行了整理,现在可以正常工作: https://kalamuna.atlassian.net/wiki/pages/viewpage.action?pageId=23134210

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2011-03-30
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-09-24
          • 2022-11-08
          • 1970-01-01
          • 2012-02-07
          相关资源
          最近更新 更多