pod install报`to_specs': Could not find 'cocoapods'错误

在执行pod install时报错:

/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'cocoapods' (>= 0.a) among 32 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/chenrongshan/.gem/ruby/2.3.0:/usr/local/lib/ruby/gems/2.3.0:/usr/local/Cellar/ruby/2.3.1/lib/ruby/gems/2.3.0', 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 `<main>'

查了资料,应该是关于gem版本的问题,直接运行

   sudo gem update --system
   sudo gem install cocoapods

接下来再来执行pod install,问题解决。

    原文作者:勗幻青山
    原文地址: https://www.jianshu.com/p/1e0f17c05fed
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞