正常的安装教程详细的、复杂的有很多,这里只对安装时出现的问题提供些解决方法。
我用的电脑之前的工程师已经安装过 CocoaPods,所以直接拿来下载第三方了,但是却报了错
[!] Unable to satisfy the following requirements:
None of your spec sources contain a spec satisfying the dependency: ‘AFNetworking (~>3.1)'.
如图:
最后移除了 ‘master’ ,重新 setup ,可以了。期间要保持网络畅通,VPN 不稳定的最好不要挂!
执行
$ pod repo remove master
先移除 master
执行
$ pod setup
再重新配置一下
提示出现 ‘Setup completed’ 字样表示配置成功,之后就可以正常的 install 了。
顺便提示下,今天我下载的这个大小是735M,想查看下载进度的话
$ cd ~/.cocoapods/
<pre name="code" class="plain" style="font-size: 14px;">$ du -sh *
根据现实的大小自行判断吧!
之前找到网上的一篇帖子,直接执行
$ pod repo update
貌似也可以,不过由于我挂了 VPN,导致中间断了好几回,后来干脆删掉重来,所以也没试过!该帖子地址:
https://github.com/CocoaPods/CocoaPods/issues/5260
最后,附上一些其他的调试的时候碰到的问题的解决方法:
安装时遇到的问题如下
http://blog.csdn.net/a_ellisa/article/details/51556685
cocoaPods 发生Unsupported options {:exclusive=>true} for target 错误 ,解决方法参考:
http://www.jianshu.com/p/bc278f6fae45
https://github.com/CocoaPods/CocoaPods/issues/4705
CocoaPods 发生 [!]Unable to add a source with url ‘https://github.com/CocoaPods/Specs.git' name ‘master’. 错误,解决方法参考: