When running pod repo update
the following error is generated:
Updating spec repo `master`
[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down
Using cocoapods 1.0.1
I'm also aware of this: Master spec-repo rate limiting post‑mortem.
Adding --verbose flag to the call shows the ruby call stack:
.rvm/gems/ruby-2.3.0/gems/cocoapods-core-1.0.1/lib/cocoapods-core/github.rb:100:in `modified_since_commit'
.rvm/gems/ruby-2.3.0/gems/cocoapods-core-1.0.1/lib/cocoapods-core/master_source.rb:32:in `requires_update?'
.rvm/gems/ruby-2.3.0/gems/cocoapods-core-1.0.1/lib/cocoapods-core/master_source.rb:14:in `update'
.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.1/lib/cocoapods/sources_manager.rb:88:in `block (2 levels) in update'
.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.1/lib/cocoapods/user_interface.rb:63:in `section'
.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.1/lib/cocoapods/sources_manager.rb:87:in `block in update'
.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.1/lib/cocoapods/sources_manager.rb:86:in `each'
.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.1/lib/cocoapods/sources_manager.rb:86:in `update'
.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.1/lib/cocoapods/command/repo/update.rb:23:in `run'
.rvm/gems/ruby-2.3.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run'
.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.1/lib/cocoapods/command.rb:50:in `run'
.rvm/gems/ruby-2.3.0/gems/cocoapods-1.0.1/bin/pod:55:in `<top (required)>'
.rvm/gems/ruby-2.3.0/bin/pod:23:in `load'
.rvm/gems/ruby-2.3.0/bin/pod:23:in `<main>'
.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
Can't find any way to workaround this and cannot run the project.
I did next in Terminal:
brew install openssl
if you don't have home brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
and repeat p.1
export PATH="/usr/local/opt/openssl/bin:$PATH"
openssl version
Output:OpenSSL 1.0.2n 7 Dec 2017
pod update
Anyone facing any similar issue where the remote hangs-up prematurely, use
ssh
to clone the repo instead.git clone git@github.com:CocoaPods/Specs.git master.
In order to use SSH to clone a GitHub repo, you need to have a GitHub account and have your SSH keys associated with it.
Follow their documentation here.
Finally managed to solve it by deleting
./cocoapods/repos/master
and runningpod install
.The more formal solution would probably go like this:
If
pod install
fails after performing the first two steps, you may need to delete yourPodfile.lock
.Why it initially failed to connect to Github is beyond me.
Just update cocoapods:
sudo gem install cocoapods
This worked like magic
Otherwise
I also encountered the same issue. In my scene, i used a mirror repo (hosted elsewhere) of cocoapods specs on github. When i updated the specs repo, it worked!