Gab*_*ves 235 git iphone objective-c ios cocoapods
我正在从一个git repo克隆一个项目,但是当我执行pod install
第一行时,我看到的是"设置CocoaPods主仓库",之后我再也看不到了,控制台就停在那里了.
我不知道发生了什么.谁知道这里发生了什么?为什么CocoaPods停在那里?
Ben*_*ton 269
您可以尝试以详细模式运行:
pod install --verbose
Run Code Online (Sandbox Code Playgroud)
这将向您展示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'...
Run Code Online (Sandbox Code Playgroud)
对我来说,上面的步骤需要相当长的时间,因为回购(2016年12月)现在是1.1 GB
lis*_*i.r 179
pod install
或者pod setup
在第一次运行时获取具有历史记录的整个仓库.您不需要该提交历史记录.
pod setup
Ctrl +C
cd ~/.cocoapods/repos
git clone --depth 1 https://github.com/CocoaPods/Specs.git master
Run Code Online (Sandbox Code Playgroud)
在体面的网络连接(4Mbps)上大约需要2分钟.master
目录大约519M.
Dan*_*hin 50
尝试使用此命令来跟踪其工作.
while true; do
du -sh ~/.cocoapods/
sleep 3
done
Run Code Online (Sandbox Code Playgroud)
Gre*_*reg 44
问题是你没有安装命令行工具,我相信.尝试在终端中运行:
sudo gem update --system
Run Code Online (Sandbox Code Playgroud)
之后,来自Apple的下载命令行工具 只搜索"命令行工具"并为您的操作系统下载正确的版本.安装后,在终端中运行:
sudo gem install cocoapods
pod setup
Run Code Online (Sandbox Code Playgroud)
小智 21
可能这些信息会有所帮助:
官方答复: 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
Run Code Online (Sandbox Code Playgroud)
我的第一次安装破解:
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
Run Code Online (Sandbox Code Playgroud)
今天需要近15分钟
Kei*_*ley 16
当CocoaPods这样做时,它正在下载整个specs repo ~/.cocoapods
.这可能需要一段时间,具体取决于您的连接.我会首先尝试明确地做pod setup
上面没有任何内容对我有用,所以这是有用的:
pod setup
Ctrl +C
pod repo remove master
cd ~/.cocoapods/repos
git clone https://github.com/CocoaPods/Specs master
Run Code Online (Sandbox Code Playgroud)
完成后就可以了.
干杯!
小智 8
我尝试过并且比克隆回购更快:
pod setup
~/.cocoapods/repos
pod install --no-repo-update
在我的项目文件夹中在那之后我终于可以看到正在安装pod
祝好运!
编辑:拉链尺寸为144 MB(2017年7月6日)
我目前正在使用一个替代解决方案。通过将 Podfile 中的存储库 URL 更改为:
source 'https://cdn.cocoapods.org/'
Run Code Online (Sandbox Code Playgroud)
变化:
- source 'https://github.com/CocoaPods/Specs.git'
+ source 'https://cdn.cocoapods.org/'
Run Code Online (Sandbox Code Playgroud)
pod setup --verbose
Run Code Online (Sandbox Code Playgroud)
我现在正在运行上面提到的命令,但正如@Joe Blow所提到的,它完全没有显示进度的信息.
但是,如果您在Mac上打开活动监视器(Windows上的任务管理器?),在"网络"选项卡下,您将看到一个名为"git-remote-https"的进程,它会显示"已接收字节数"的大小增加.下载大约300MB后,它停止了,然后我可以在终端窗口看到进一步的进展.
这只发生一次.
主回购具有+ -1GB (2016年11月).
要跟踪进度,您可以使用活动监视器应用程序并查找git-remote-https
.
下次它(pod setup
或pod repo update
)只会快速更新所有spec-repos ~/.cocoapods/repos
.
我使用了以下4个命令
cd ~/.cocoapods/repos
git clone "https://github.com/CocoaPods/Specs" master --depth 1
cd master
git fetch --unshallow
pod setup
Run Code Online (Sandbox Code Playgroud)
我按照预期花了时间,但至少我没有在屏幕上爬楼梯,想知道在后台发生了什么.