macOS安装Cocoapods,执行pod setup下载较慢报错

在macOS上安装Cocoapods执行pod setup时,可能会遇到下载缓慢或失败的问题,如SSL_ERROR_SYSCALL、Operation timed out等错误。解决方案包括在网络状况好的环境下重试或手动下载CocoaPods master repo并放置于指定目录。

Cocoapods安装时,当执行pod setup,Setting up CocoaPods master repo,可能会卡住不动了,Cocoapods在将它的信息下载到 ~/.cocoapods里(差不多900多兆);如果等了一段时间后提示 Setup completed的时候,说明已经完成了。

当出现:

Cloning into 'master'...

fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60

Cloning into 'master'...

fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': Operation timed out after 300010 milliseconds with 0 out of 0 bytes received

Cloning into 'master'...

fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': Operation timed out after 300044 milliseconds with 0 out of 0 bytes received

都说明下载出问题了

解决办法一:

需要网络环境较好的情况下重新进行执行set up命令,重新下载;也有网友建议:可以把电脑连上手机热点,再次执行pod setup,如果家里有矿,这个办法可行?

解决办法二:

根据安装时终端给的提示,手动下载CocoaPods master repo包(下载地址:https://github.com/CocoaPods/Specs.git/)放在`/Users/mac名称/.cocoapods/repos`(mac名称为终端输入:whoami 得到的字符串)下,附错误提示如下:

fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54

[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.

You can try adding it manually in `/Users/dfsj/.cocoapods/repos` or via `pod repo add`.

附方法二git下载资源存放文件夹截图

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值