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

Finally I got Solution For installation of CocoaPods in OS X El Capitan

First remove or uninstall all available Gems by using following command in your terminal(which is located in your Launchpad>Other>Terminal or you can also find that in Finder>Applications>Utilities>Terminal)

gem uninstall --all
sudo gem uninstall --all

When after successful uninstallation of all Gems, Then write following command in your terminal

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

Hope all of you will be awaiting for this answer. anyway, this works for me hence according to me it is best suitable solution to that particular problem.


I used brew because this commands doesn't work for me. (I had some linking errors).

Anyway:

brew uninstall cocoapods

brew install cocoapods

Warning: cocoapods 1.2.1 is already installed, it's just not linked.

brew link cocoapods

Done. Worked for me


This is a ruby gems related problem. Usually, it happens when it "knows" there is a gem, but it can't find it. It might have been caused by different problems (you are in different version of ruby or a PATH has not been updated after some ruby/gem update related manipulations or gems installed using old cocoapods version and now you are trying to run a new version of pods or some other problem). If I can remember it correctly pods has changed where it saves the gems at some (0.2 -> 0.3) version.

Anyhow, here is old SO answer that might help you.

# Uninstall all available gems
gem uninstall --all
sudo gem uninstall --all

# Reinstall cocoapods
sudo gem install cocoapods

# == RELAUNCH == terminal window and run
pod setup