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?
For those of you that have ruby installed through RVM and want a quick fix (preferring not to read per Bruno's request) just try this:
For a more details, here is the link where I found the solution.
http://railsapps.github.com/openssl-certificate-verify-failed.html
BTW, I didn't have to touch my certificates on Ubuntu.
This worked for me:
gem install --local [path to downloaded gem file]
update_rubygems
gem --version
If you're using
rails-assets
If you were using
https://rails-assets.org/
to manage your assets, no answers will help you. Even converting tohttp
won't help.The simplest fix is using this source instead,
http://insecure.rails-assets.org
. This has been mentioned in their homepage.same problem but with different gem here:
temporarily solution:
gem install builder -v '3.0.0'
makes it possible to continuebundle install
Update
Now that I've karma wh..err mined enough from this answer everyone should know that this should have been fixed.
re: via Ownatik again bundle install fails with SSL certificate verification error
My answer is still correct and left below for reference if that ends up not working for you.
Honestly the best temporary solution is to
via user Ownatik
what they mean is at the top of the
Gemfile
in your rails application directory changesource 'https://rubygems.org'
to
source 'http://rubygems.org'
note that the second version is http instead of https
On windows7 you can download the cacert.pem file from here and set the environementvariable SSL_CERT_FILE to the path where you store the certificate eg
or you can set the variable in your script like this
ENV['SSL_CERT_FILE']="C:/users/<username>/cacert.pem"
Replace <username> with you own username.