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
来源:

你可能感兴趣的:(pod install/update 报错CDN: trunk URL couldn't be downloaded:- connect(2) for "raw.githubuserconten...)