CocoaPods安装问题
主要步骤:
sudo gem install cocoapods
pod setup
验证是否安装成功:
pod search SDWebImage
常见问题:
1 sudo gem install cocoapods没有反应。
解决方法:替换成淘宝的源
gem sources --remove https://rubygems.org/
gem sources -a http://ruby.taobao.org/
检查source是否正确替换:
gem sources -l
2 pod setup执行过程非常慢,几乎没有反应。解决方法:耐心等待。。。。
3 执行pod setup的时候提示如下错误:
[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`
解决方法:清除CocoaPods缓存后重新执行pod setup, 命令如下:
sudo rm -fr ~/.cocoapods/repos/master
pod setup
原因:http://guides.cocoapods.org/using/troubleshooting.html#im-getting-permission-errors-while-running-pod-command
参考:
http://code4app.com/article/cocoapods-install-usage
http://linyehui.me/2014/12/14/cocoapods-permission-errors-while-pod-update.html