Cocopods 遇到error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refu...

最近使用Cocopods添加第三方时,遇到以下报错

error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)

意思就是:错误 :无法打开到raw.githubusercontent.com:443的TCP连接(连接被拒绝-“ raw.githubusercontent.com”端口443的connect(2))

报错信息图.png

不要慌~

1、首先前往文件夹,/private/etc 的目录下,找到hosts文件;
/private/etc 的目录图.png

2、然后把hosts文件copy一份到桌面,打开,删除包括 githubusercontent的行,保存关闭,然后把桌面这个改过的文件拖到原来的文件夹里,替换原来的
1577242491717.jpg

3、最后重新输入pod update 或者 pod install就不会出现那种问题了。

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

推荐阅读更多精彩内容