更新cocoapods遇到的问题
Cloning into'master'...
error: RPC failed; curl56SSLRead()returnerror -36
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
更新gem,卸载cocoapods等操作,可以参考文章最下边的链接,这里不重复了。
然后尝试手动克隆Github上Spec到cocoapods/repos/路径下,失败。
把Github吧Spec下载下来,然后手动放到repos下,执行pod setup,失败,error没记录
最后找到一个方案
建议先看完,再操作
1、只有一个xcode的情况,打开终端,输入以下命令:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
2、多个xcode
需要修改命令:
sudo xcode-select -switch /Applications/Xcode 7.3.1.app/Contents/Developer
根据你默认的xcode来修改在/Applications/和/Contents/Developer中间的app的名字,如果你默认的是Xcode x.x.x.app,中间就要替换掉。
也可以在终端里输入:
sudo xcode-select --print-path
输出:
/Applications/Xcode.app/Contents/Developer
这步结束。
然后删除repos目录下master
sudo rm -fr ~/.cocoapods/repos/master
再执行pod setup,等了一会,成功了。
打开用了pods的工程,执行pod update,报错
[!] The dependency `FMDB (~>2.3)`isnotusedinany concrete target.等等
网上找到答案,修改Podfile格式,下边的#是注释
platform:ios,'8.0'
#use_frameworks!个别需要用到它,比如reactiveCocoa
target 'MyApp' do
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
修改完Podfile的格式,在执行pod update,记得要到Podfile所在的目录下
个人认为,正确的顺序就是
检查gem,更新到最新,现在是2.6.7
然后按照上边的步骤开始执行就可以了。
祝好运,现在开始操作吧。
参考链接