When I run bundle install
for my Rails 3 project on Centos 5.5 it fails with an error:
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3
read server certificate B: certificate verify failed
(https://bb-m.rubygems.org/gems/multi_json-1.3.2.gem)
An error occured while installing multi_json (1.3.2), and Bundler cannot continue.
Make sure that `gem install multi_json -v '1.3.2'` succeeds before bundling.
When I try to install the gem manually (by gem install multi_json -v '1.3.2'
) it works. The same problem occurs with several other gems. I use RVM (1.12.3), ruby 1.9.2, bundler 1.1.3.
How to fix it?
Replace the ssl gem source with non-ssl as a temp solution:
Temporary solution (as alluded to by Ownatik):
Create or modify a file called .gemrc in your home path, including the line
:ssl_verify_mode: 0
This will prevent bundler from checking the SSL certificates of gems when it attempts to install them.
For *nix devices, 'home path' means
~/.gemrc
. You can also create/etc/gemrc
if you prefer. For Windows XP, 'home path' meansc:\Documents and Settings\All Users\Application Data\gemrc
. For Windows 7,C:\ProgramData\gemrc
This is How you fix this problem on Windows:
download .perm file then set the SSL_CERT_FILE in command prompt
https://gist.github.com/fnichol/867550
I was able to track this down to the fact that the binaries that
rvm
downloads do not play nice with OS X's OpenSSL, which is old and is no longer used by the OS.The solution for me was to force compilation when installing Ruby via
rvm
:My permanent fix for Windows:
Download the CACert , save as
C:\ruby\ssl_certs\GlobalSignRootCA.pem
from http://guides.rubygems.org/ssl-certificate-update/Create system variable named "SSL_CERT_FILE", set to
C:\ruby\ssl_certs\GlobalSignRootCA.pem
.Try again:
gem install bundler
:Download rubygems-update-2.6.7.gem .
Now, using your Command Prompt:
After this,
gem --version
should report the new update version.You can now safely uninstall rubygems-update gem: