我试图用pod安装命令更新现有的pod,但它需要很长时间才能运行。

verbose模式显示它被卡在下一行(永远)

更新规范回购主机 $ /usr/bin/git pull -no-rebase -no-commit

在它被卡住之后就没有网络活动了。


当前回答

我也遇到了同样的问题,我通过运行下面给出的命令来解决它

pod repo remove master
pod setup
pod install

其他回答

我也有同样的问题,然后我意识到我仍然在“非常糟糕的网络”上运行网络调节器。把它关掉就解决了问题。

希望这能帮助到别人。

找到了另一种下载cocoapods的方法,就是下载这里提供的快照之一。它有点旧,但是.bz2压缩文件下载起来要快得多。一旦我下载了它,我将它复制到~/。cocoapods/repos/然后我使用bzip2 -dk *.bz2解压缩它。

解压缩需要一段时间,完成后,我将新解压缩文件的扩展名更改为.tar,并执行tar xvf *.tar来解压缩。这将显示正在创建的文件列表,也需要一段时间。

Finally when I ran pod repo list while inside the project folder, it showed the master folder had been added as a repo. Because I still kept getting an error that it was unable to find the specification for the pod I was looking for, I went to the master folder and did git fetch and then git merge. The git fetch took the longest, about an hour at 50 KB/s. I used fetch and merge instead of pull, as I was having issues with it, i.e. fatal: the remote end hung up unexpectedly. It is now up to date and I was able to get the pod I wanted.

正如在其他答案中提到的,它需要永远,因为cocoapods主回购的大小是巨大的。可以通过以下步骤减少此时间。

1)在你的github存储库上创建一个私有的specs文件路径。在podfile中提供这个路径https://github.com/yourpathForspecs.git'作为源文件。

2)确定你需要的所有存储库及其依赖关系(在podspec中提到过)。Json文件的cocoapods为这些存储库),并获得他们的podspec。cocoapods的Json文件。添加这些podspec。Json文件及其文件夹(例如螺栓的最新版本文件夹)。

3)在podfile中删除源“https://github.com/CocoaPods/Specs.git”

4) pod更新

这将花费更少的时间,因为这只需要获取和下载你需要的豆荚,而不是整个cocoapods存储库。 在我的案例中,它将pod更新时间从平均15-20分钟减少到最多3-4分钟。

2019年11月为我解决

你好,我尝试了很多东西,但没有工作。试着连接到这个网站https://cdn.cocoapods.org/如果你不能使用VPN和做pod安装等。不要忘记使用verbose来理解正在发生的事情。

可能的解决方式:

更新Cocoa Pods可以解决这个问题 重新清洁和新鲜的安装舱


更新CocoaPods

开端子及类型:

$ sudo gem update cocoapods

重新安装豆荚

步骤1

从你的项目中删除所有的豆荚(棘手的部分):

手动

删除项目构建阶段的所有pod记录(红色标记)

删除libPods。在Frameworks文件夹下的a

现在转到项目目录并删除Podfile。锁定*,**Pods文件夹和工作区(从垃圾中删除)。

自动使用CocoaPods去集成

安装

$ [sudo] gem install cocoapods-deintegrate

Run

$ pod deintegrate

步骤2

在这里,我们将再次安装Pods

更改您的位置和目录

$ cd yourprojectdirectory

通过添加你需要的行来编辑podfile

$ open -a Xcode podfile 

or

$ nano podfile

最后再次安装吊舱

$ pod install

希望这能有所帮助