I tried to install cocoapods (http://cocoapods.org/) on my OSX Mountain Lion.
moshe-mbp:~ moshem$ gem install cocoapods
ERROR: Could not find a valid gem
I had the same error. To fix just run the following commands (I know you've ran some but humor me):
brew update
brew install openssl
brew link openssl --force
brew install curl-ca-bundle
After that, open a new shell or source your files and all should be good to go :)
UPDATE:
To update your paths you'll need to edit your /etc/paths file so do something like:
sudo vim /etc/paths
In there is should look something like:
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
What you want to do is to ensure that /usr/local/bin
is at the top of the file. So change it to something like:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
Hope that fixes it!