简体   繁体   English

安装的Ruby版本在macOS和Bundle中有所不同

[英]Installed Ruby version are different in macOS and Bundle

I'm not using RVM but brew to install and update Ruby and Gem version up-to-date. 我没有使用RVM,而是用brew来安装和更新Ruby和Gem的最新版本。 But when I was trying bundle install , I got an error showed that the Ruby version requirement does not conform. 但是,当我尝试bundle install ,出现错误,表明Ruby版本要求不符合。

I added ruby '2.1.9' to the Gemfile and did some check: 我在Gemfile中添加了ruby'2.1.9 ruby '2.1.9'并做了一些检查:

(●—●) ↪ bundle platform                                                                                
Your platform is: universal.x86_64-darwin16

Your app has gems that work on these platforms:
* ruby

Your Gemfile specifies a Ruby version requirement:
* ruby 2.1.9

Your Ruby version is 2.0.0, but your Gemfile specified 2.1.9
(●—●) ↪ ruby -v                                                                                         
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
(●—●) ↪ gem -v                                                                                         
2.6.11

I found that there is a lower version Ruby in my project. 我发现我的项目中有一个较低版本的Ruby。

/Users/veck/Desktop/Project/vendor/bundle/ruby/2.0.0

How do I fix this problem? 我该如何解决这个问题?

I found that I successfully did bundle install with following action: 我发现我成功完成了bundle install并执行以下操作:

gem install bundler

After this installation, my vendor/bundle/ruby has one more version 2.4.0 . 安装完成后,我的供应商/捆绑销售/红宝石有另一个版本2.4.0 Then I retry bundle install and all works fine. 然后,我重试bundle install ,一切正常。

Note : But 2.0.0 version of ruby still stay in vendor/bundle. 注意 :但是红宝石的2.0.0版本仍然保留在供应商/捆绑包中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM