Pod installation error: Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named master

I followed the steps on PhoneGap website and got stuck on the step using command “pod install” and got the error message as below:

MyMac:PhoneGapTest username$ pod install

  • Managing phonegap / cordova project with git
  • env: node: No such file or directory (using jenkings, windows machine, node and a remote web interface)
  • GIT: Two different repositories with one shared folder
  • Installing PhoneGap getting “error not found: git”
  • Directory structure for cross-platform phonegap project
  • Adding plugins from specific revision Github project to the Cordova project
  • 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.

    Here is the information for my machine
    1. Mac OS 10.12 Sierra
    2. Xcode 8.0 (8A218a) [Setting in “Xcode/Peference/Locations/Command Line Tools” is set to “Xcode 8.0 (8A218a)”, path is “/Application/Xcode.app”]

    Please suggest on how to resolve this. Thank you!

  • How to skip “Hit return to start merge resolution tool” and open mergetool automatically
  • Create a patch by comparing a specific branch on the remote with a specific local branch
  • How to checkout a particular version in git from git log?
  • git rebase fails with Unknown exit code (128) from command: git-merge-recursive
  • Git: Best way to add only some parts of a file from another branch?
  • How do I enable msysgit colored output when using console2
  • 3 Solutions collect form web for “Pod installation error: Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named master”

    If you recently installed the latest version of XCode in your mac, I would suggest to have a look at the Preferences once.

    Go to XCode => Preferences => Locations and update the Command Line Tools like this:

    enter image description here

    Now try pod update and it will work like before.

    @Mohshin Shah, thanks a lot. You make my day! I stucked with this for two weeks. Your suggestion is the foundation to the workaround. Below are what I’ve done.

    —————– first try: using buffer size as given ——————-
    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.

    —————– second try: double the buffer size ————————-
    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.

    —————– third try: the workaround, note: this might also work with the given buffer size ————–
    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.

    —————– checking the result ————————-
    My-Mac:PhoneGapTest username$ ls
    PhoneGapTest PhoneGapTestTests Podfile Pods
    PhoneGapTest.xcodeproj PhoneGapTestUITests master

    I had this issue on my mac as well.

    Please go to this link: https://github.com/CocoaPods/CocoaPods/issues/4293

    I fixed this issue by doing the following:

    • cd to ~/.cocoapods/repos

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

    Tried update cocapods, re init pod and update repo, none of that works for me.

    Hope it helps.

    Git Baby is a git and github fan, let's start git clone.