为什么我会收到错误消息“您的 Ruby 版本是 2.0.0,但您的 Gemfile 指定了 2.2.2"?虽然我安装了 2.2.2 [英] Why do I get the error "Your Ruby version is 2.0.0, but your Gemfile specified 2.2.2" although I have 2.2.2 installed

查看:53
本文介绍了为什么我会收到错误消息“您的 Ruby 版本是 2.0.0,但您的 Gemfile 指定了 2.2.2"?虽然我安装了 2.2.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 rbenv 并且我收到错误 Your Ruby version is 2.0.0, but your Gemfile specified 2.2.2 当我运行 bundle install 命令时我的项目.奇怪的是,我实际上已经安装了 2.2.2 版本(正如我的 Gemfile 指定的那样),而不是 2.0.0 版本.(见下图).

I'm using rbenv and I get the error Your Ruby version is 2.0.0, but your Gemfile specified 2.2.2 when I run the bundle install command in my project. The strange thing is that I've actually got the 2.2.2 version installed (as my Gemfile specifies), and not the 2.0.0 version. (See image below).

我尝试了此线程中提供的解决方案:你的 Ruby 版本是 2.0.0,但是你的 Gemfile 指定了 2.1.0,但是没有效果.

I tried the solution offered in this thread: Your Ruby version is 2.0.0, but your Gemfile specified 2.1.0, but it had no effect.

如果这有什么不同的话,我使用的是装有 Yosemite 的 MacBook Air.

I'm on an MacBook Air with Yosemite if that makes any difference.

更新:

  • which ruby​​ -> Users/myuser/.rbenv/shims/ruby
  • ruby -v -> ruby 2.2.2p95 (2015-04-13 修订版 50295) [x86_64-darwin14]
  • rbenv global 2.2.2rbenv rehash,没有作用
  • 哪个包 -> /usr/bin/bundle
  • gem env-> - GEM 路径:
    • /Users/myuser/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0
    • /Users/myuser/.gem/ruby/2.2.0
    • which ruby -> Users/myuser/.rbenv/shims/ruby
    • ruby -v -> ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
    • rbenv global 2.2.2 and rbenv rehash, has no effect
    • which bundle -> /usr/bin/bundle
    • gem env-> - GEM PATHS:
      • /Users/myuser/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0
      • /Users/myuser/.gem/ruby/2.2.0

      推荐答案

      我终于用这个线程解决了我的问题 Bundler 不能使用 rbenv,找不到 [gem],

      I finally solved my problem using this thread Bundler not working with rbenv, could not find [gem],

      在重新安装 rbenv 后使用这些命令:

      by using these commands after reinstalling rbenv:

      • gem install --no-ri --no-rdoc bundler
      • rbenv rehash
      • bundle --path=vendor/bundle

      这篇关于为什么我会收到错误消息“您的 Ruby 版本是 2.0.0,但您的 Gemfile 指定了 2.2.2"?虽然我安装了 2.2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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