Unable to add a source with url

35,798

Solution 1

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.

Solution 2

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.

Solution 3

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

Solution 4

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

Solution 5

  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.

Share:
35,798

Related videos on Youtube

rajesh
Author by

rajesh

Updated on March 16, 2022

Comments

  • rajesh
    rajesh about 2 years

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

    • Shobhakar Tiwari
      Shobhakar Tiwari about 9 years
      CocoaPods expects to own the repo named master or check xcodeproject folder should be same as of cocoapods
    • Jasper
      Jasper almost 9 years
      SKT, rajesh> anyone knows solution to this?
    • Jacksonkr
      Jacksonkr almost 8 years
      Which answer worked for you? I tried all but only Tahir's answer worked for pod update.
  • Jacksonkr
    Jacksonkr almost 8 years
    I tried every answer here but this is the ONLY one that produced results after pod update
  • Mihir Oza
    Mihir Oza over 7 years
    I tried many solutions finally your solution worked for me. Thanks a lot.
  • davidcondrey
    davidcondrey over 7 years
    cd ~/.cocoapods/repos && git clone https://github.com/CocoaPods/Specs.git master worked for me
  • user578386
    user578386 over 7 years
    Man you saved my day...big time
  • Developer
    Developer over 7 years
    Worked! How did you know this is an answer?
  • NotABot
    NotABot over 7 years
    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