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

对项目执行 pod install 的时候遇到了如下异常:

Cloning spec repo `cocoapods` from `https://github.com/CocoaPods/Specs.git`
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `cocoapods`.
You can try adding it manually in `/Users/fyhsurvivors/.cocoapods/repos` or via `pod repo add`.

 

解决办法

首先,因 CocoaPods 的库文件较大 https://github.com/CocoaPods/Specs.git 的方式很容易中断,建议尝试切换为 ssh 的方式进行 clone 操作 git@github.com:CocoaPods/Specs.git

其次,终端中输入如下命令,处理 cocoapods 的 repos;

rm -rf ~/.cocoapods
mkdir -p ~/.cocoapods/repos
cd ~/.cocoapods/repos
git clone git@github.com:CocoaPods/Specs.git

注:如上操 clone 时对网络环境要求较高

若成功,则可以尝试在对应的项目中执行 pod install 即可

若失败,则会出现如下异常:

fyhsurvivors@survivors-deMacBook-Pro repos % git clone https://github.com/CocoaPods/Specs.git master
Cloning into 'master'...
remote: Enumerating objects: 402, done.
remote: Counting objects: 100% (402/402), done.
remote: Compressing objects: 100% (383/383), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
error: rev-list died of signal 9
fatal: remote did not send all necessary objects

解决办法可详见 Error fetching https://gems.ruby-china.org/: bad response Not Found 404 - Dev


以上便是此次分享的全部内容,希望能对大家有所帮助!

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值