[!] The `master` repo requires CocoaPods 1.0.0 - (currently using 0.39.0)
Update CocoaPods, or checkout the appropriate tag in the repo.
所以要升级cocoapods啦
参考:
http://www.cnblogs.com/brycezhang/p/3675670.html
http://stackoverflow.com/questions/37154321/performing-a-deep-fetch-of-the-master-specs-repo-to-improve-future-performance
命令行更新(安装)步骤【更新】
$ sudo gem update --system // 先更新gem,国内需要切换源
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
\*\*\* CURRENT SOURCES \*\*\*
https://ruby.taobao.org/
$ sudo gem install cocoapods // 安装cocoapods
$ pod setup
和安装过程是一样的,再次查看版本
$ pod --version
0.39.0
Done!!
但是 万万没想到 在最后一步上 pod setup时
lalalMacBook-Pro:XLForm-master duanxingjie$ pod setup
Setting up CocoaPods master repo
Performing a deep fetch of the `master` specs repo to improve future performance
[!] /usr/bin/git -C /Users/lalala/.cocoapods/repos/master fetch --unshallow
error: RPC failed; curl 56 SSLRead() return error -36
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
所以 找度娘解决办法 输入命令
sudo rm -fr ~/.cocoapods/repos/master
然后 继续pod setup 等待。。。。。然后还是不行
最后尝试 pod update --verbose --no-repo-update 后依然失败
原因是所有的项目的 Podspec 文件都托管在https://github.com/CocoaPods/Specs。第一次执行pod setup时,CocoaPods 会将这些podspec索引文件更新到本地的~/.cocoapods/目录下,这个索引文件比较大,有 300多M 左右,在执行一次pod install之后会增加到700多M。所以第一次更新时非常慢,然后下载失败
该如何解决呢
1. git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master使用 CocoaPods 的镜像索引
一个叫akinliu的朋友在gitcafe和oschina上建立了 CocoaPods 索引库的镜像,因为 gitcafe 和 oschina 都是国内的服务器,所以在执行索引更新操作时,会快很多。如下操作可以将 CocoaPods 设置成使用 gitcafe 镜像:
2. pod setup
OK!