您的 Ruby 版本是 2.2.4,但您的 Gemfile 指定的是 2.3.0? [英] Your Ruby version is 2.2.4, but your Gemfile specified 2.3.0?

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

问题描述

我正在尝试在 Git Bash 中 bundle install 一个 ruby​​ 项目,但我收到了上述消息.

ruby -v

<块引用>

ruby 2.2.4p230(2015-12-16 修订版 53155)[i836-mingw32]

gem -v

<块引用>

2.3.0

对 Ruby 来说是新手,所以真的很令人沮丧.我正在尝试做下面的项目http://www.viralrails.com/?p=25

解决方案

发生这种情况是因为您在 Gemfile (2.3.0) 中指定了 Ruby 版本,而此版本未安装或不是当前或默认版本.

不要像上面所说的那样删除 ruby​​ '2.3.0' 行.你的应用可能依赖于这个版本.执行以下操作:

1) 检查您是否安装了 Ruby 2.3.0.如果您使用的是 rvm,这可以由

完成

rvm 列表

如果你使用的是 rbenv

rbenv 版本

2)如果您的已安装版本列表中没有此 Ruby 版本,请通过发出以下命令进行安装

rvm 安装 2.3.0

如果你使用的是 rbenv

rbenv 安装 2.3.0

3) 如果您已经安装了 Ruby 2.3.0 或已完成上述步骤 2,请进入您的应用目录并发出以下命令

rvm 使用 2.3.0

如果你使用的是 rbenv

rbenv 本地 2.3.0

然后运行

捆绑安装

我相信一切都会好起来的.

希望对你有帮助!

I'm trying to bundle install a ruby project in Git Bash but I'm getting the above message.

ruby -v

ruby 2.2.4p230 (2015-12-16 revision 53155) [i836-mingw32]

gem -v

2.3.0

New to Ruby so its really frustrating. I'm trying to do the project below http://www.viralrails.com/?p=25

解决方案

This happens because you are specifying a Ruby version in your Gemfile (2.3.0) and this version is not installed or is not the current or default version.

Don't remove the line ruby '2.3.0' as someone said above. You app may have dependencies to this version. Do the following:

1) Check if you have Ruby 2.3.0 installed. If you are using rvm this may be done by

rvm list

and if you are using rbenv by

rbenv versions

2) If you don't have this Ruby version in your list of installed versions, then install it by issuing the following command

rvm install 2.3.0

and if you are using rbenv by

rbenv install 2.3.0

3) If you already had Ruby 2.3.0 installed or completed step 2 above, enter your app directory and issue the following command

rvm use 2.3.0

and if you are using rbenv by

rbenv local 2.3.0

Then run

bundle install

and I believe things will be ok.

Hope it helps!

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

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