ios 学习笔记 1 安装cocoapod 遇到的问题

1. 但是  万万没想到 在最后一步上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。所以第一次更新时非常慢,然后下载失败

该如何解决呢

使用 CocoaPods 的镜像索引

一个叫akinliu的朋友在gitcafe和oschina上建立了 CocoaPods 索引库的镜像,因为 gitcafe 和 oschina 都是国内的服务器,所以在执行索引更新操作时,会快很多。如下操作可以将 CocoaPods 设置成使用 gitcafe 镜像:

1. git clonehttps://git.coding.net/CocoaPods/Specs.git~/.cocoapods/repos/master

2. pod setup

OK!

你可能感兴趣的:(ios 学习笔记 1 安装cocoapod 遇到的问题)