1 今天打算升级 CocoaPods 时出现的问题
 /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:318:in `to_specs': Could not find 'cocoapods' (>= 0.a) among 35 total gem(s) (Gem::LoadError)Checked in 'GEM_PATH=/Users/xurui/.gem/ruby/2.0.0:/Library/Ruby/Gems/2.0.0:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0', execute `gem env` for more information  from /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:327:in `to_spec'  from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'  from /usr/local/bin/pod:22:in `<main>'
   复制代码
 2 我在 stackoverflow 上看到同样的问题,可能是 gem 的版本问题或者安装路径问题
 *** CURRENT SOURCES ***
https://ruby.taobao.org/
   复制代码
 
 gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.com/
   复制代码
 3 清除 gem
4 清除掉 gem 之后,再卸载 CocoaPods
 sudo gem install cocoapods
   复制代码
 5 最后再重新安装一下 CocoaPods
 sudo gem install -n /usr/local/bin cocoapods
   复制代码
 6 检查一下版本
 *****MacBook-Pro:~ haha$ pod --version0.39.0
   复制代码
 参考
http://stackoverflow.com/questions/26795553/cocoapods-installation-setup-error
以下将记录 cocoaPods 的其他使用问题
安装 cocoaPods 时太慢
我是切换了清华大学的镜像
 cd ~/.cocoapods/reposgit clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git masterpod setup
   复制代码
 
参考地址Unable to find a pod with name, author, summary, or description matching#Unable to find a pod with name, author, summary, or description matching 删除 cocoapods 的索引,然后重新 search
 rm ~/Library/Caches/CocoaPods/search_index.jsonpod search AFNetworking
   复制代码
 
然后触发操作Creating search index for spec repo '.git'.. Done!参考地址
评论