cocoapods

pod install/update 报错Connection

2020-02-25  本文已影响0人  吐泡泡的鱼Y

场景:

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

上一篇 下一篇

猜你喜欢

热点阅读