"bundle install" causes Gem::RemoteFetcher::FetchError on each gem

bundler, openssl, ruby-on-rails, rubygems, rvm

Solution

Do you have OpenSSL installed? You don't mention your OS, but on Ubunutu (or other Debian-based distros) you do:

sudo apt-get install openssl

Failing that, try http://railsapps.github.com/openssl-certificate-verify-failed.html

Problem

When calling ``` rails new project ``` The process progresses until I hit bundle install. At that point: ``` identical vendor/plugins/.gitkeep run bundle install Fetching gem metadata from https://rubygems.org/......... Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=unknown state: sslv3 alert handshake failure (https://d2chzxaqi4y7f8.cloudfront.net/gems/rake-0.9.2.2.gem) An error occured while installing rake (0.9.2.2), and Bundler cannot continue. Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling. ``` I can install the gem manually with gem install and launch rails new again, and the error repeats for the next gem. I end up installing manually every single gem. I use rvm 1.13.0 single user.

Original source