- 首先
gem sources -l
看一下有几个源 然后把不是https://ruby.taobao.org的源给移除掉
类似于:gem sources —remove https://rubygems.org
如果没有https://ruby.taobao.org,就执行
gem sources -a https://ruby.taobao.org/
将国内淘宝的源添加上再执行:
sudo gem install cocoa pods
pod setup
这样CocoaPod的安装就完成了。
今天在使用cocoapod加载afnetworking时出现了一个错误:
Specs satisfying the AFNetworking (~> 3.0.4)
dependency were found, but they required a higher minimum deployment target.
通过上网查找资料,发现是因为我写Podfile文件时开头只写了:platform :ios
解决方法是:Podfile 文件 中 platform:ios, ‘8.0’ 后边的 8.0 是平台版本号 ,一定要加上