pods 安装在项目中的 操作 可以和视频中的操作一致:http://blog.cocoapods.org/CocoaPods-1.8.0-beta/,
一:期间在执行 pod install 时可能出现
通过 CocoaPods 执行 pod install 升级项目依赖库的时候,终端执行 install 命令后等待许久抛出了如下异常信息:
[!] CDN: trunk Repo update failed - 40 error(s):
CDN: trunk URL couldn't be downloaded: [https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/7/2/d/GCDWebServer/1.2/GCDWebServer.podspec.json](https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/7/2/d/GCDWebServer/1.2/GCDWebServer.podspec.json), error: execution expired
解决办法
首先,与网络有关也可能与源有关,通过尝试切换网络后异常失败,便尝试切换源配置
$ cd ~/.cocoapods/repos
$ pod repo remove master
$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
其次,变更成功后进入项目工程并配置对应的 podFile 文件
此次尝试了三种 source 属性,具体如下:
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
#source 'https://github.com/CocoaPods/Specs.git'
#source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
最终采用了 清华大学开源软件镜像站
再其次,配置好如上 source 后,执行如下命令清除当前的 trunk
pod repo remove trunk
最后,再次尝试 pod install 即可。
二:在clone时,本人 失败10多次,很多时候一开始就失败,有时候在99%时失败,通过以下配置了一下,最后成功:
1.可以尝试将缓存变大 git config http.postBuffer 524288000(500兆),可以设置的再大,1g 2g。
2. git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
增加最低速度时间,然后尝试继续clone