我从一个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

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

其他回答

尝试这个命令来跟踪它的工作。

while true; do
  du -sh ~/.cocoapods/
  sleep 3
done

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

从cocoapods 1.7.2开始,你可以使用cdn而不是github。它燃烧得很快,挂不起来。从cocopods 1.8.0开始,cdn是默认的。

To use the CDN source in your Podfile: If you don't have private specs: source 'https://cdn.cocoapods.org/' If you have private specs: source 'https://github.com/artsy/Specs.git' - source 'https://github.com/CocoaPods/Specs.git' + source 'https://cdn.cocoapods.org/' Doing this will break your Podfile.lock, so you are likely to need to run pod update to see the changes (be careful, this may update your Pods also). If you have a CI setup, it is recommended to cache the new repo dir as it is very small and would save even more time. With 1.7.2 it should be located at ~/.cocoapods/repos/cocoapods- (yes, with a -), but we're looking to improve the naming in an upcoming release.

更多信息:

CocoaPods 1.7.2 -主Repo CDN完成! CocoaPods 1.8测试版来了!

也许这些信息会有帮助:

官方答案: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分钟

我正在使用监控下载进度

while true; 
do   
du -sh ~/.cocoapods/;   
sleep 3; 
done

进展非常缓慢……失败了几次。 但是在使用命令行git config——global http增加了git缓冲区限制之后。下载速度大大提高,在./cocoapods文件夹上下载了总共347 Mb后,进度似乎停止了,网络活动也停止了。 但在等待几分钟后,发现cocoapod正在验证和提取回购,使总大小达到853 Mb。

注:2016年10月23日。