Its a common issue after updating mac operating system to OS X EI Capitan but easy to solve this issue. Simply copy the below command and paste in your terminal.
sudo gem install -n /usr/local/bin cocoapods
It worked fine for me.
Detailed...
I am SAI SANDEEP NUKALA, the admin of iosrevisited.blogspot.com. I have 6.5+ years of experience as an iOS developer and made about 20+ apps on App Store.