For Windows Users (and maybe others)
Rubygems.org has a guide that not only explains how to fix this problem, but also why so many people are having it: SSL Certificate Update
The reason for the problem is rubygems.org switched to a more secure SSL certificate (SHA-2 which use 256bit encryption). The rubygems command line tool bundles the reference to the correct certificate. Therefore rubygems itself can’t be updated using an older version of rubygems. Rubygems must first be updated manually.
First find out what rubygems you have:
rubygems –v
Depending on whether you have a 1.8.x, 2.0.x or 2.2.x, you will need to download an update gem, named “rubygems-update-X.Y.Z.gem”, where X.Y.Z is the version you need.
Running 1.8.x: download: https://github.com/rubygems/rubygems/releases/tag/v1.8.30
Running 2.0.x: download: https://github.com/rubygems/rubygems/releases/tag/v2.0.15
Running 2.2.x: download: https://github.com/rubygems/rubygems/releases/tag/v2.2.3
Install update gem:
gem install –-local full_path_to_the_gem_file
Run update gem:
update_rubygems --no-ri --no-rdoc
Check that rubygems was updated:
rubygems –v
Uninstall update gem:
gem uninstall rubygems-update -x
At this point, you may be OK. But it is possible that you do not have the latest public key file for the new certificate. To do this:
Download the latest certificate, (currently AddTrustExternalCARoot-2048.pem)
from https://rubygems.org/pages/download.
All of the certs are also located at: https://github.com/rubygems/rubygems/tree/master/lib/rubygems/ssl_certs
Find out where to put it:
gem which rubygems
Put this file in the “rubygems\ssl_certs” directory at this location.
As per rubygems commit, the certificates are moved to more specific directories. Thus, currently the certificate(AddTrustExternalCARoot-2048.pem) is expected to be on the following path lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot-2048.pem