我从一个git repo克隆一个项目,但当我执行pod安装时,我看到的第一行是“设置CocoaPods主repo”,之后我看不到任何更多的东西,控制台停在那里。

我不知道发生了什么。有人知道这里发生了什么吗?CocoaPods为何止步于此?


当前回答

我使用了以下4个命令

cd ~/.cocoapods/repos
git clone "https://github.com/CocoaPods/Specs" master --depth 1
cd master
git fetch --unshallow
pod setup

我花了预期的时间,但至少我不必站在屏幕前思考后台发生了什么。

其他回答

也许这些信息会有帮助:

官方答案:http://blog.cocoapods.org/Master-Spec-Repo-Rate-Limiting-Post-Mortem/

作为本次讨论的结果https://github.com/CocoaPods/CocoaPods/issues/4989

简要: CocoaPods存储库从GitHub获取了大量数据,这就是问题所在。自1.0.0.beta.6版本以来已有更改。

本文档提供的提示:

If for whatever reason you cannot upgrade to version 1.0.0 just yet, you can perform the following steps to convert your clone of the Master spec-repo from a shallow to a full clone:

$ cd ~/.cocoapods/repos/master
$ git fetch --unshallow

我的第一次安装方法:

1. pod setup
2. Ctrl+C
After that I could find ~/.cocoapods/repos/ empty directory 
3. Download  https://github.com/CocoaPods/Specs/archive/master.zip
4. unpack it to ~/.cocoapods/repos/
5. Move to project folder
6. pod install --no-repo-update

而今天则需要将近15分钟

以上这些对我都不起作用,所以下面的方法起作用了:

pod setup
Ctrl +C
pod repo remove master
cd ~/.cocoapods/repos 
git clone https://github.com/CocoaPods/Specs master

一旦完成,它就起作用了。

干杯!

上面的解决方案都不适合我,我不得不卸载coacoapods,然后安装一个特定的版本,然后一切才适合我

sudo gem uninstall cocoapods

然后

sudo gem install cocoapods -v 1.7.5

现在,即使是冗长也显示了进步

$ pod setup --verbose

Setting up CocoaPods master repo

Cloning spec repo `master` from `https://github.com/CocoaPods/Specs.git` (branch `master`)
  $ /usr/bin/git clone https://github.com/CocoaPods/Specs.git --progress -- master
  Cloning into 'master'...
  remote: Enumerating objects: 295, done.        
  remote: Counting objects: 100% (295/295), done.        
  remote: Compressing objects: 100% (283/283), done.        
  Receiving objects:  20% (744493/3722462), 132.93 MiB | 567.00 KiB/s   

当CocoaPods这样做的时候,它会下载整个specs repo到~/. CocoaPods。这可能需要一段时间,这取决于您的连接。我会试着先用pod设置明确地做它

刚刚安装了主回购,很兴奋地看到我们有一个下载进度,见截图;)

CocoaPods 1.2.0版(1月28日)修复了这个问题,感谢所有贡献者和Danielle Tomlinson。