12

I just installed CocoaPods by following these instructions:

Now I opened an Xcode project which has CocoaPods in it, I opened the terminal, went into that project folder and typed "pod install" as required, and I am getting an error back:

$ pod install
Setting up CocoaPods master repo
[!] Pod::Executable clone 'https://github.com/CocoaPods/Specs.git' master

Cloning into 'master'...
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSL certificate problem: Invalid certificate chain

/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:217:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:210:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:24:in `<top (required)>'
    from /usr/bin/pod:23:in `load'
    from /usr/bin/pod:23:in `<main>'

I have no idea what this is about. Can someone help me? This is the first time I try to do anything with CocoaPods on OS X Mavericks.

Thanks!

Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
Mathieu
  • 1,984
  • 4
  • 13
  • 16

6 Answers6

12

Github's SSL certificate looks fine from my end, but maybe you have distrusted it for some reason, or you are using a proxy. To resolve:

Using the Safari browser (not Chrome, Firefox or Opera) on Mac OS X 10.9 (Mavericks) visit https://github.com (no www.).

If an alert pops up, press the "Show Certificate" button, check "Always Trust", and then "Continue."

If no alert pops up, press the green or gray Security button by the URL:

enter image description here

Then make sure "Always trust" is checked on the certificate.

If this doesn't resolve your issue, try temporarily disabling any proxy servers you might be running, such as Charles.

After that, pod install should work.

Note: A portion of my answer text was copied from this answer.

Community
  • 1
  • 1
Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
  • It fixed the issue! pod install was just very very slow at first and I thought it was still not working after this step. Thanks Aaron! – Mathieu Jan 08 '14 at 00:37
  • 1
    @Mathieu I always use `pod install --verbose` so I can see the progress, otherwise I get impatient. – Aaron Brager Jan 08 '14 at 01:13
  • 2
    It appears that the always trust button is no longer there in 10.9.2. My GitHub cert is no longer trusted, even though it was fine yesterday. – Matthew Knippen Feb 27 '14 at 21:34
  • 2
    Had a similar issue trying to clone from Stash. Answer here: http://stackoverflow.com/questions/23208426/getting-ssl-error-when-attempting-to-clone-a-stash-repository. – Jonathan Apr 22 '14 at 01:10
8

Under the hood pod uses just a regular git, so disabling SSL validation for git will solve the problem:

GIT_SSL_NO_VERIFY=true pod install
scope
  • 1,967
  • 14
  • 15
3

If you already have installed Cocoapods then write following code in terminal

sudo gem update
Bhavik Modi
  • 1,517
  • 14
  • 29
2

You can try this in your terminal;

echo insecure >> ~/.curlrc 
Emre Agbal
  • 109
  • 1
  • 4
0

My Digicert Certificate was twice in the keychain and the used one was invalid. Deleting the expired one did the job. Thanks for point me there!

andreas-supersmart
  • 4,114
  • 2
  • 18
  • 13
0

when I run pod install, I encountered the problem : !] Pod::Executable clone 'https://github.com/CocoaPods/Specs.git' master

Cloning into 'master'... fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': SSL certificate problem: Invalid certificate chain

And I finally resolved it by deleting expired certificates in keychains. When I open my terminal and run command pod install, it finally succeeded.

Hope It helps