Cocoapods遇到CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs...
最近自己做了一个cocoapod库,代码改好了,先本地验证一下podspec
pod lib lint MWPhotoBrowser.podspec --use-libraries --allow-warnings
报错了
e failed - 10 error(s): CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/c/8/7/MBProgressHUD/0.5/MBProgressHUD.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443) 。。。
原因出在MWPhotoBrowser引用了另一个库MBProgressHUD,验证的过程中,需要下载MBProgressHUD,下载失败了。
为什么会失败呢?因为我现在用的cocoapods版本是1.8.4,默认的源是这个
trunk - Type: CDN - URL: https://cdn.cocoapods.org/ - Path: /Users/wangjun/.cocoapods/repos/trunk
我使出浑身解数,一直连不上这个源,最后我猜测可能是他的服务器出了问题。
默认的源不能用,但其实我们可以退一步,手动指定使用master源
pod lib lint MWPhotoBrowser.podspec --use-libraries --allow-warnings --sources='https://github.com/CocoaPods/Specs.git'
结果成功了!