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
Current release of rvm does a lot better job handling this things, run:
rvm get head
rvm reload
rvm autolibs enable
rvm reinstall 1.9.3 --disable-binary
Make sure to follow any displayed instructions - it's all there to help you.
If you are in China
This is fixed by avoiding https and using the insecure http instead. Running this worked for me.
gem source -a http://rubygems.org/
I fixed it by only appending to the PATH variable in my ~/.bash_profile, which in my case meant changing
export PATH="/usr/local/mysql/bin:$PATH"
export PATH=$M2:$PATH
export PATH=$JAVA_HOME/bin:$PATH
to
export PATH="$PATH:/usr/local/mysql/bin"
export PATH=$PATH:$M2
export PATH=$PATH:$JAVA_HOME/bin
In terminal, type nano ~/.bash_profile
to start editing.
Try using http://rubygems.org/ (without SSL) as a source — that fixed the error for me.
gem source -r https://rubygems.org/
gem source -a http://rubygems.org/
gem install cocoapods
You can try to update OpenSSL from source instead:
curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz.asc
curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz
gpg --verify openssl-1.0.1b.tar.gz.asc
tar xvzf openssl-1.0.1b.tar.gz
cd openssl-1.0.1b
perl ./Configure shared zlib --prefix=/opt/local darwin64-x86_64-cc
make
make test
sudo make install
source