Pod安装错误:[!]无法使用名为master的https:// github.com/CocoaPods/Specs.git`添加源代码

use*_*095 5 git xcode github ios cordova

我按照PhoneGap网站上的步骤操作,并使用命令"pod install"卡在步骤上,并收到如下错误消息:

MyMac:PhoneGapTest用户名$ pod install

设置CocoaPods master repo
[!]无法添加https://github.com/CocoaPods/Specs.git名为url的源master.
您可以尝试手动~/.cocoapods/repos或通过手动添加pod repo add.

以下是我的机器的信息
1. Mac OS 10.12 Sierra
2. Xcode 8.0(8A218a)[Xcode/Peference/Locations/Command Line Tools中的设置]设置为"Xcode 8.0(8A218a)",路径为"/ Application" /Xcode.app"]

请建议如何解决此问题.谢谢!

atu*_*tri 15

如果您最近XCode在Mac中安装了最新版本,我建议您查看Preferences一次.

转到XCode => Preferences => Locations并更新Command Line Tools如下:

在此输入图像描述

现在尝试pod update它会像以前一样工作.


wei*_*wei 7

我的mac上也有这个问题.

请访问此链接:https://github.com/CocoaPods/CocoaPods/issues/4293

我通过执行以下操作修复了此问题:

  • cd到 ~/.cocoapods/repos

  • git clone https://github.com/CocoaPods/Specs.git master

尝试更新cocapods,重新启动pod和更新repo,这些都不适用于我.

希望能帮助到你.


use*_*095 2

@Mohshin Shah,非常感谢。你让我开心!我坚持了两周。您的建议是解决方法的基础。以下是我所做的。

----------------- 第一次尝试:使用给定的缓冲区大小 ------------------- ------ ----------- 第二次尝试:将缓冲区大小加倍------------------------
My-Mac:PhoneGapTest username$ git config http.postBuffer 524288000
My-Mac:PhoneGapTest username$ pod install
Setting up CocoaPods master repo
[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git named master.
You can try adding it manually in ~/.cocoapods/repos or via pod repo add.


My-Mac:PhoneGapTest username$ git config http.postBuffer 1048576000
My-Mac:PhoneGapTest username$ pod install
Setting up CocoaPods master repo
[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git named master.
You can try adding it manually in ~/.cocoapods/repos or via pod repo add.

----------------- 第三次尝试:解决方法,注意:这也可能适用于给定的缓冲区大小 --------------
My-Mac:PhoneGapTest username$ git clone https://github.com/CocoaPods/Specs.git master
Cloning into 'master'...
remote: Counting objects: 865802, done.
remote: Compressing objects: 100% (13060/13060), done.
remote: Total 865802 (delta 6507), reused 0 (delta 0), pack-reused 851785
Receiving objects: 100% (865802/865802), 348.54 MiB | 948.00 KiB/s, done.
Resolving deltas: 100% (375143/375143), done.
Checking connectivity... done.
Checking out files: 100% (114193/114193), done.

-----------------检查结果-------------------------
My-Mac:PhoneGapTest username$ ls
PhoneGapTest PhoneGapTestTests Podfile Pods
PhoneGapTest.xcodeproj PhoneGapTestUITests master