場(chǎng)景:
pod search 能夠正常使用
pod install 報(bào)錯(cuò)詳情:
[!] 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 報(bào)錯(cuò)詳情:
[!] 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
添加以下內(nèi)容
199.232.28.133 raw.githubusercontent.com
重新執(zhí)行
pod install或者pod update