10

Upgrading from Yosemite to El Capitan seem to have wiped out the already installed CocoaPods. When I pod install Alamofire/SwiftyJson, it says 'Pod command not found', and as per the stackoverflow solutions I uninstalled cocoapods and trying to reinstall it with the commands

 - sudo gem uninstall cocoapods
 - sudo gem install cocoapods

I get the error:

"Could not find a valid gem 'cocoapods' (>= 0) in any repository"

Did go through ALL the solutions mentioned by the Gurus under the issue https://github.com/CocoaPods/CocoaPods/issues/3736

mainly tried this which seem to have worked for many. still doesn't work for me.

sudo gem install -n /usr/local/bin cocoapods

tried modifying the permissions etc as per the solutions provided in the above link and the SO link

http://stackoverflow.com/questions/30812777/cannot-install-cocoa-pods-after-uninstalling-results-in-error?rq=1

Nothing works, EVERYTHING leads to the same error "Could not find a valid gem 'cocoapods' (>= 0) in any repository"

I have also raised a issue on

https://github.com/CocoaPods/CocoaPods/issues/5232
Cœur
  • 37,241
  • 25
  • 195
  • 267
Naishta
  • 11,885
  • 4
  • 72
  • 54
  • Donot Mark it as duplicate as none of the solutions in SO/Cocoapods Issues link works. Appreciate if someone can really get to the gut of it and help me fix it – Naishta May 01 '16 at 21:47

2 Answers2

60

I faced the same problem and it was fixed by using the following command

$ sudo gem install cocoapods --source http://rubygems.org
Alaa Aljohani
  • 621
  • 5
  • 5
3

I struggled with same issue 1 week, finally this works for me

Disable IPv6 and try again with sudo gem install cocoapods --source http://rubygems.org

Issues seems with network

Few more details give on rugby gems forum - https://help.rubygems.org/discussions/problems/31074-timeout-error

Tarun Seera
  • 4,212
  • 4
  • 27
  • 41