pod install/update 报错CDN: trunk URL couldn't be downloaded:- connect(2) for "raw.githubuserconten...

场景:

pod search 能够正常使用

pod install 报错详情:

[!] CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/c/8/7/MBProgressHUD/1.2.0/MBProgressHUD.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)

pod update 报错详情:

[!] CDN: trunk Repo update failed - 2 error(s):

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/1/e/4/AFOAuth2Client/1.0.0/AFOAuth2Client.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)

CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/a/a/6/AFAmazonS3Client/2.0.1/AFAmazonS3Client.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)

解决方法:

通过修改hosts解决此问题

终端命令修改hosts:

sudo vim /etc/hosts

添加以下内容

199.232.28.133 raw.githubusercontent.com

重新执行

pod install或者pod update

作者:泡泡de妈妈
链接:https://www.jianshu.com/p/79dd8381509d
来源:简书

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容