使用cocoapod时错误的Ruby版本 [英] The wrong Ruby version when working with cocoapod

查看:134
本文介绍了使用cocoapod时错误的Ruby版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的项目是用Objective-C编写的,并使用了旧版本的cocoapod(0.38.0).

Our project is written in Objective-C, and use an old version of cocoapod (0.38.0).

我的所有同事都使用旧版本的Ruby(2.0.0).我有最新版本的Ruby(2.3.1),所以我需要像同事一样安装更多的旧Ruby版本(2.0.0).

All my colleagues use the old version of Ruby (2.0.0). I have the latest version of Ruby (2.3.1), so I need to install more the old Ruby version (2.0.0) as my colleagues have.


rvm install 2.0.0
rvm use 2.0.0

我cocoapod安装

I cocoapod install


pod _0.38.0_ install

并得到这样的错误:


Ignoring executable-hooks-1.3.2 because its extensions are not built.  Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built.  Try: gem pristine gem-wrappers --version 1.2.7
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'cocoapods' (= 0.38.0) among 11 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/chipbk10/.rvm/gems/ruby-2.0.0-p648:/Users/chipbk10/.rvm/gems/ruby-2.0.0-p648@global', execute `gem env` for more information
        from /usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:328:in `to_spec'
        from /usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
        from /usr/local/bin/pod:22:in `

我尝试按照建议尝试,但这没有帮助

I tried as suggested, but it doesn't help


gem pristine executable-hooks --version 1.3.2
gem pristine gem-wrappers --version 1.2.7

另一个奇怪的地方是错误,出现了不同版本的Ruby:2.0.0、2.3.1、2.3.0

Another strange thing is in the error, there are different versions of Ruby appear: 2.0.0, 2.3.1, 2.3.0

这是我拥有的所有红宝石版本

This is all ruby versions I have


rvm list rubies

=* ruby-2.0.0-p648 [ x86_64 ]
   ruby-2.3.1 [ x86_64 ]

我的cocoapod版本是

my cocoapod version is


pod --version
1.0.1

推荐答案

可能您已在系统中安装了ruby 2.3.0,并在rvm中安装了版本2.0.0和2.3.1.Ruby 2.3.0比rvm在PATH变量列表中排在首位,因此系统可以看到它.如果无法解决问题,请提供哪个红宝石"和回显$ PATH"的结果.

Probably you have ruby 2.3.0 installed with system and versions 2.0.0 and 2.3.1 installed in rvm. Ruby 2.3.0 is first in PATH variables list than rvm one, so system sees it. If it won't help please provide results of "which ruby" and "echo $PATH".

这篇关于使用cocoapod时错误的Ruby版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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