1

Our project is written in Objective-C, and use an old version of cocoapod (0.38.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

I cocoapod install

pod _0.38.0_ install

and get an error like this:

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

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 ]

my cocoapod version is

pod --version
1.0.1
4

1 回答 1

2

可能你已经安装了 ruby​​ 2.3.0,系统和版本 2.0.0 和 2.3.1 安装在 rvm 中。Ruby 2.3.0 在 PATH 变量列表中比 rvm 排在第一位,因此系统会看到它。如果没有帮助,请提供“which ruby​​”和“echo $PATH”的结果。

于 2016-08-30T14:31:03.517 回答