1 今天打算升級CocoaPods時(shí)出現(xiàn)的問題
/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的版本問題或者安裝路徑問題
1 檢查一下gem的版本
gem sources -l
2 正常輸出結(jié)果應(yīng)該是淘寶鏡像
*** CURRENT SOURCES ***
https://ruby.taobao.org/
2.1 由于taobao Gems 源已停止維護(hù)作谚,現(xiàn)由 ruby-china 提供鏡像服務(wù),所以需要切換一下
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.com/
3 清除gem
sudo gem uninstall --all
4 清除掉gem之后,再卸載CocoaPods
sudo gem install cocoapods
5 最后在重新安裝一下CocoaPods
sudo gem install -n /usr/local/bin cocoapods
6 檢查一下版本
*****MacBook-Pro:~ haha$ pod --version
0.39.0
參考
http://stackoverflow.com/questions/26795553/cocoapods-installation-setup-error
以下將記錄cocoaPods的其他使用問題
安裝cocoaPods時(shí)太慢
我是切換了清華大學(xué)的鏡像
cd ~/.cocoapods/repos
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
pod 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.json
pod search AFNetworking
然后觸發(fā)操作
Creating search index for spec repo '.git'.. Done!
參考地址