Friday, April 5, 2013

Playing with Ruby on Windows --- Fixing SSL issues when running bundle install

If  you run bundle install and run into this message:
"Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/mime-types-1.22.gem)
An error occured while installing mime-types (1.22), and Bundler cannot continue. Make sure that `gem install mime-types -v '1.22'` succeeds before bundling."

Where the gem name maybe different, it will be helpful to have a look at this solution:

Download the cacert.pem file from http://curl.haxx.se/ca/cacert.pem. Save this file to C:\dev\cacert.pem or whatever directory you can use for this.
Now make ruby aware of your certificate authority bundle by setting SSL_CERT_FILE. To set this in your current command prompt session, type:
set SSL_CERT_FILE=C:\dev\cacert.pem

More info at: https://gist.github.com/fnichol/867550
It worked like a charm for me!

Hope it helps

No comments: