ios Pod 安装停留在“设置 CocoaPods 主存储库”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21022638/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 23:03:19  来源:igfitidea点击:

Pod install is staying on "Setting up CocoaPods Master repo"

iosobjective-cgitcocoapodspod-install

提问by Gabriel Goncalves

I'm cloning a project from a git repo, but when I execute pod installthe first line I see is "Setting up CocoaPods Master repo" and after that I can't see anything more, the console stops there.

我正在从 gitpod install存储库克隆一个项目,但是当我执行第一行时,我看到的是“设置 CocoaPods 主存储库”,之后我看不到任何东西,控制台停在那里。

I don't know what is happening. Anyone knows what's happening here? Why Does CocoaPods stop there?

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

回答by Ben Clayton

You could try running in verbose mode:

您可以尝试在详细模式下运行:

pod install --verbose

This'll show you what cocoapods is up to:

这将向您展示 cocoapods 的用途:

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' master
  Cloning into 'master'...

(as suggested here)

如建议here)

For me the above step took quite a long time as the repo (Dec 2016) is now 1.1 GB

对我来说,上述步骤花了很长时间,因为 repo(2016 年 12 月)现在是1.1 GB

回答by lisowski.r

pod installor pod setupfetches whole repo with history when you first time run it. You don't need that commit history.

pod install或者pod setup在您第一次运行时获取带有历史记录的整个 repo。你不需要那个提交历史。

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

It takes around 2 mins on decent network connection (4Mbps). masterdirectory is around 519M big.

在体面的网络连接 (4Mbps) 上大约需要 2 分钟。master目录大约 519M 大。

回答by Daniel Shin

Try this command to track its work.

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

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

回答by Greg

The issue is that you haven't got command line tools installed, I believe. Try run in terminal:

问题是你没有安装命令行工具,我相信。尝试在终端运行:

sudo gem update --system

after that download command line tools from Applejust search for 'Command Line Tools' and download the right version for your OS. Once you install it run in terminal:

之后,从Apple下载命令行工具, 只需搜索“命令行工具”并为您的操作系统下载正确的版本。安装后在终端中运行:

sudo gem install cocoapods
pod setup

回答by Tina Zh

May be this information will be helpful:

可能这些信息会有所帮助:

Official answer:http://blog.cocoapods.org/Master-Spec-Repo-Rate-Limiting-Post-Mortem/

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

As a result of this discussion https://github.com/CocoaPods/CocoaPods/issues/4989

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

Briefly:CocoaPods repository experiences a huge volume of fetches from GitHub and it was the problem. Changes have been available since version 1.0.0.beta.6.

简而言之:CocoaPods 存储库经历了来自 GitHub 的大量提取,这就是问题所在。自版本 1.0.0.beta.6 起已进行更改。

Tips from this document:

本文档中的提示:

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

My hack to first installation:

我第一次安装的技巧:

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

Today it takes near 15 minutes

今天需要将近 15 分钟

回答by Keith Smiley

When CocoaPods is doing that it is downloading the entire specs repo to ~/.cocoapods. This could take a while depending on your connection. I would try doing it explicitly first with pod setup

当 CocoaPods 这样做时,它会将整个规范存储库下载到~/.cocoapods. 这可能需要一段时间,具体取决于您的连接。我会先尝试明确地做pod setup

回答by praneybehl

Nothing above worked for me, so this is what worked:

以上没有对我有用,所以这是有效的:

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

Once completed it worked.

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

Cheers!

干杯!

回答by Federico Jordan

What I tried and faster than clonning the repo:

我尝试过的并且比克隆 repo 更快:

  1. pod setup
  2. Ctrl +C after creating the master directory
  3. Download .zip from https://github.com/CocoaPods/Specsmaster
  4. Copy the content to ~/.cocoapods/repos
  5. pod install --no-repo-updatein my project folder
  1. pod setup
  2. 创建主目录后 Ctrl +C
  3. https://github.com/CocoaPods/Specsmaster下载 .zip
  4. 复制内容到 ~/.cocoapods/repos
  5. pod install --no-repo-update在我的项目文件夹中

After that I finally could see the pods being installed

之后我终于可以看到正在安装的豆荚

Good luck!

祝你好运!

EDIT: The zip size is 144 MB (Jul 6 2017)

编辑:zip 大小为 144 MB(2017 年 7 月 6 日)

回答by LynAs

I used the following 4 commands

我使用了以下 4 个命令

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

I took time as expected, but at least I didn't have to stair at the screen wondering whats happening in the background.

我按预期花了时间,但至少我不必走到屏幕前想知道背景中发生了什么。

回答by Ahsas Sharma

pod setup --verbose 

I am running the above mentioned command right now but as mentioned by @Joe Blow, it shows absolutely no information on the progress.

我现在正在运行上述命令,但正如@Joe Blow 所提到的,它绝对没有显示有关进度的信息。

But if you open the Activity Monitor on Mac (Task Manager on Windows?), under the 'Network' tab you will see a process named 'git-remote-https'and it shows the size of 'Received Bytes' increasing. After downloading about 300MB it stopped and then I could see further progress in the Terminal window.

但是,如果您在 Mac 上打开活动监视器(Windows 上的任务管理器?),在“网络”选项卡下,您将看到一个名为“git-remote-https”的进程,它显示“已接收字节”的大小在增加。下载大约 300MB 后,它停止了,然后我可以在终端窗口中看到进一步的进展。