📚 开源资源分享——颜佐光的个人书架
✉️ 联系站长
书架 / Java / swift

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

2021-06-08 19:14 · 约 1,662 字 · 浏览 2,947 次swift

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

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

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`.

解决办法

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

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

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

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

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
以上便是此次分享的全部内容,希望能对大家有所帮助!

← 返回《Java》目录书架 →