1

I am using pods first time in the project . I created a new project and followed following process :

  1. Downloaded master from the github ,as terminal asked me to do it manually

  2. fired : pod init method . This command generated Podfile in my Xcode project folder

  3. Then I added a line in the pod file : pod 'Alamofire', '2.0.2'

4 . Then I fired pod install command and I am getting following error in the terminal window :

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

I am following this tutorial : https://www.raywenderlich.com/97014/use-cocoapods-with-swift Please suggest workaround for this issue. following is my pod file :

platform :ios, "8.0"
 use_frameworks!
target 'PodsTest' do
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for PodsTest
  pod 'Alamofire', '2.0.2'
  target 'PodsTestTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'PodsTestUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end
rmaddy
  • 314,917
  • 42
  • 532
  • 579
V-Xtreme
  • 7,230
  • 9
  • 39
  • 79

3 Answers3

1

In you pod file mention the code like this.

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Alamofire', '2.0.2'

and then try pod install

1

You just need to update repo

Run pod repo update on terminal.

Try to use latest Alamofire => pod 'Alamofire', '~> 4.0'

Hope it will help you.

Ekta Padaliya
  • 5,743
  • 3
  • 39
  • 51
0

Are your Command Line Tools set up correctly according to the Xcode version you are using?

In Terminal:

sudo xcode-select -r

And then in XCode:

Xcode -> Preferences -> Locations -> Command Line Tools

worthwhile checking, this might cause the problem

Gefilte Fish
  • 1,600
  • 1
  • 18
  • 17