更换pod repo的源

2020-04-22  本文已影响0人  片片碎

1、查看之前的源

pod repo

https:
- Type: file system
- URL:  
- Path: /Users/Feng/.cocoapods/repos/https:
trunk
- Type: CDN
- URL:  https://cdn.cocoapods.org/
- Path: /Users/Feng/.cocoapods/repos/trunk

2、删除源

//默认的是trunk源是CDN "https://cdn.cocoapods.org/"
//执行删除
pod repo remove trunk

3、增加新源

//默认的是trunk源是CDN "https://cdn.cocoapods.org/"
//执行删除
pod repo add  master  https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
pod clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
pod repo update --verbose

3、报错解决

错误一
RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
错误二
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

解决方案
sudo vim /private/etc/hosts

然后把下面这段ip-域名映射信息复制进去:
151.101.185.194 github.global.ssl.fastly.net
192.30.253.112 github.com
151.101.184.133 assets-cdn.github.com
151.101.184.133 avatars0.githubusercontent.com
151.101.112.133 avatars1.githubusercontent.com

上一篇 下一篇

猜你喜欢

热点阅读