最近升级系统后,CocoaPod升级出现了错误
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'cocoapods' (>= 0) among 59 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/local/bin/pod:22:in `<main>'
1.检查gem 的数据源 gem sources -l
http://ruby.taobao.org
可能是跟iOS9一样,Capitan 10.11禁止了http的请求了,改成https的协议头就好了
$ sudo gem update --system
切换 gem source
$ gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
2.使用指令,安装成功
sudo gem install -n /usr/local/bin cocoapods
3.下载文件
pod install --verbose --no-repo-update
pod update --verbose --no-repo-update
4.CocoaPod search 查看不到最新版本库问题
pod repo update --verbose
清除本地缓存,重新repo