Pod not found: Could not find 'cocoapods' (>= 0) among 64 total gem(s) (Gem::LoadError)

Uninstalling and reinstalling CocoaPods from the Terminal fixed the issue for me (see the CocoaPods documentation for more information):

gem uninstall cocoapods
gem install cocoapods

For me it was

sudo gem install cocoapods

Try:

sudo pod setup

Since you installed cocoapods as supervisor (sudo), there are files that supervisor can see that you can not.

This also means that after you add a pod to a podFile, you'll also need to run

sudo pod install

instead of

pod install

It ultimately might be better to undo the sudo install of cocoa pods and use RVM.

With RVM you can have different versions of gem sets (including different versions of cocoapods, if required). By going this route, you can then bypass having to run pod commands as sudo.

Tags:

Cocoapods