CocoaPods的使用问题
2016-01-05 本文已影响533人
sudo
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的版本问题或者安装路径问题
1 检查一下gem的版本
gem sources -l
2 正常输出结果应该是淘宝镜像
*** CURRENT SOURCES ***
https://ruby.taobao.org/
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:~ xurui$ pod --version
0.39.0
参考
http://stackoverflow.com/questions/26795553/cocoapods-installation-setup-error