32

[!] Unable to add a source with url git@github.com:CocoaPods/Specs.git named master-1. You can try adding it manually in ~/.cocoapods/repos or via pod repo add. please any help

wzso
  • 3,482
  • 5
  • 27
  • 48
rajesh
  • 351
  • 1
  • 3
  • 8

12 Answers12

36

Please follow this link for this problem. Its possible to forgott set your newly install Xcode path on command-line tool. Xcode-->Preferences-->Locations-->Command line tool --> set your Xcode.

itzmebibin
  • 9,199
  • 8
  • 48
  • 62
Jashu
  • 1,061
  • 13
  • 19
  • Seems odd to claim here that the correct answer is the first thing on that link, when the user there clearly said that it didn't fix their problem... – FinrodFelagund Aug 29 '22 at 19:26
30

You may need to reset your command line tools:

sudo xcode-select -r

I was receiving the same error message. Then I noticed, that the wrong Xcode environment was selected (it pointed to an old version which I deleted in the meantime). The command above resets it to the default command line path.

Alternatively you might have no command line tools installed. In that case, download them from the Apple site and install them.

Rainer Schwarze
  • 4,725
  • 1
  • 27
  • 49
10

Go to ~/.cocoapods/repos and run git clone https://github.com/CocoaPods/Specs.git master

Tahir Iqbal
  • 311
  • 3
  • 5
  • I tried every answer here but this is the ONLY one that produced results after `pod update` – Jacksonkr May 23 '16 at 13:31
  • 2
    `cd ~/.cocoapods/repos && git clone https://github.com/CocoaPods/Specs.git master` worked for me – davidcondrey Oct 12 '16 at 06:11
  • 1
    I got this error: error: RPC failed; result=56, HTTP code = 20032 MiB | 926 KiB/s `fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed` – NotABot Dec 22 '16 at 06:24
5

When you get above error it means, you didn't do the pod setup

instructions:

  1. First install the cocoapods in you Mac if it is not already installed. Use terminal.

    Xcode 7 + 8

    sudo gem install cocoapods --pre

    Xcode 7

    sudo gem install activesupport -v 4.2.6 sudo gem install cocoapods

  2. Set up the pod using command pod setup

after doing these initial set up you are ready to make your project as work space project. You can follow these commands using terminal

  1. Goto Project location folder : ~/Destop/SampleProject
  2. Create pod file : pod init
  3. List down your cocoa pods init it :

    # Uncomment the next line to define a global platform for your project
    #platform :ios, '9.0'
    
    target 'SampleProject' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!
    
    # Pods for SampleProject
    pod 'SlideMenuControllerSwift'
    
    
    target 'SampleProjectTests' do
     inherit! :search_paths
    # Pods for testing
    end
    
    target 'SampleProjectUITests' do
     inherit! :search_paths
     # Pods for testing
    end
    

    end

it will help you.

or else

After installation of cocoapods than you can download the cocoa master repo manually into Mac.

    $ cd /Users/username/.cocoapods/repos 
    $ git clone https://github.com/CocoaPods/Specs.git master
Anil Gupta
  • 1,155
  • 1
  • 19
  • 26
3
  1. $ cd /Users/username/.cocoapods/repos
  2. remove folder master if it exists
    rm -rf master
    $ git clone https://github.com/CocoaPods/Specs.git master
  3. pod setup

that's all.

wzso
  • 3,482
  • 5
  • 27
  • 48
2

I had the same problem , actually the problem was that command line was not able to find a path to my Xcode. Therefore the simplest solution that i found was to give a suitable location of xcode.

For it:

  1. Go to Xcode > Preferences
  2. Choose Location tab
  3. Select the Xcode in Command Line tools:- enter image description here

thats it. I hope that works for you. All the best

Kunal Gupta
  • 2,984
  • 31
  • 34
1

For me, I had to pod setup first.

CppLearner
  • 16,273
  • 32
  • 108
  • 163
1

Please Follow this steps:

Open Terminal

1] sudo xcode-select -r

2] Xcode-->Preferences-->Locations-->Command line tool --> set your Current Xcode Version.

3] Edit Podfile and save

4] pod install

Thats it.

saurabh rathod
  • 1,090
  • 7
  • 7
1

I was getting the same error with only difference that there was different URL. I was trying to install private pods from private repository. What helped is to add ssh-key to profile.

  1. Generate ssh-key using this guide: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/. Hope this helps.
  2. Add it in your profile settings on Bitbucket(or Github or whatever you are using)
1

You need to have access to the pod spec repo first. For me I wasn't having access.So this issue happened.

0

This is often happening on initial pod install. I tried all and this steps helped me

Please follow these steps:

1] pod repo update

2] pod install

I hope that works for you. All the best

0

Meet the same error and I have solved it by :

1. Open your terminal
2. Go to the directory    : cd /User/YOUR_NAME/.cocoapods/repos/
3. remove the master file : rm -rf master
4. Clone the CocoaPods    : git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master

Note. I add the target path ~/.cocoapods/repos/master to avoid the mistake that your current file path is not ~/.cocoapods/repos/master

5. Run the setup          : pod setup 
guozqzzu
  • 839
  • 10
  • 12