前言
自从CocoaPods升级到1.8后,就把CDN切换为默认的spec repo源,导致最近使用pod update会出现以下情况
[!] CDN: trunk Repo update failed - 17 error(s):
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/1/d/4/CocoaAsyncSocket/0.0.1/CocoaAsyncSocket.podspec.json, error: Operation timed out - SSL_connect
但cdn因为q的原因,导致一直连不上
解决办法
- podfile文件中指定source源:
source 'https://github.com/CocoaPods/Specs.git'
或者指定为国家不错的镜像站【推荐】
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
- 删除trunk源
pod repo remove trunk
其他
另外推荐CocoaPods 镜像,由于https://github.com/CocoaPods/Specs.git日益庞大,进行一次pod setup,国内几十K/s的速度,几乎耗费几小时才能安装完毕,所以推荐从CocoaPods镜像进行clone
$ cd ~/.cocoapods/repos
$ pod repo remove master
$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
参考:
https://juejin.im/post/5dce6dc4e51d453d63662718
https://www.jianshu.com/p/bf1cbe49cb5d