您的Ruby版本是2.1.0,但是您的Gemfile指定了2.0.0 [英] Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0

查看:119
本文介绍了您的Ruby版本是2.1.0,但是您的Gemfile指定了2.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Gemfile中,我指定了ruby版本2.0.0:

In my Gemfile I specified ruby version 2.0.0:

ruby '2.0.0'

但是我的控制台告诉我我有2.1.0dev:

But my console tells me I have 2.1.0dev:

$ ruby -v
ruby 2.1.0dev (2013-09-16 trunk 42951) [x86_64-darwin12.4.0]

我正在使用rbenv,它告诉我我没有安装2.1.0,

I am using rbenv and it tells my I don't have 2.1.0 installed,

$ rbenv versions
system
* 2.0.0-dev

捆绑更新或捆绑安装说:

Bundle update or bundle install says:

"Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0"

但是使用'rbenv local 2.0.0-dev'再次使我使用ruby 2.1.0dev 。此外:

but using 'rbenv local 2.0.0-dev' leaves me with ruby 2.1.0dev again. Furthermore:

$ rbenv global
2.0.0-dev

$ cat ~/.bash_profile:
export PATH="$HOME/.rbenv/bin:$PATH"
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

据我所知,甚至还没有2.1.0dev。

As far as I know, 2.1.0dev doesn't even exist yet.

如何选择红宝石2.0.0?

How can i get ruby 2.0.0 selected?

推荐答案

您可能需要更新 ruby​​-build 的版本,以确保您具有更新,其中 ruby​​-2.0.0-dev 切换为遵循 ruby​​_2_0_0 分支。

You may need to update your version of ruby-build to make sure you have the update where ruby-2.0.0-dev switched to follow the ruby_2_0_0 branch.

尝试运行 ruby​​-build --version 并确保它是其中之一(或稍后):

Try running ruby-build --version and make sure it's one of these (or later):


  • v20130907

  • v20130901

  • v20130806

  • v20130628

  • v20130518

  • v20130514

  • v20130501

  • v20130408

  • v20130227

  • v20130226

  • v20130225

  • v20130907
  • v20130901
  • v20130806
  • v20130628
  • v20130518
  • v20130514
  • v20130501
  • v20130408
  • v20130227
  • v20130226
  • v20130225

否则,运行 brew upgrade ruby​​-build

这篇关于您的Ruby版本是2.1.0,但是您的Gemfile指定了2.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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