1

When I run bundle install on ruby 2.1.2 I get:

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/rake-10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.2'` succeeds before bundling.

When I run gem install rake I get:

ERROR:  Could not find a valid gem 'bundle' (>= 0), here is why:
      Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

When I run which bundle I get:

/usr/local/rvm/gems/ruby-2.1.2@global/bin/bundle

This error is preventing me from doing development work on localhost:3000 before deploying.

Does anyone know how to resolve this issue?

PatJ
  • 5,996
  • 1
  • 31
  • 37
Codestudio
  • 525
  • 3
  • 5
  • 28

2 Answers2

14

In the Gemfile in your rails application directory change:

source 'https://rubygems.org'

to

source 'http://rubygems.org'
Papaya Labs
  • 1,079
  • 9
  • 11
  • This seems to work out partially. I get the following: 'Your bundle is complete! Gems in the group production were not installed.' But I still get the following error and I still don't get access to localhost:3000: ERROR: Could not find a valid gem 'rake' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/latest_specs.4.8.gz) – Codestudio Mar 23 '15 at 07:34
  • 1
    Using http is insecure and could result in trojan gems. – Jason Apr 04 '17 at 19:20
2

Upgrade to the latest version of Ruby or at least a newer version than the one you have. I was using 2.0.0-p247 and received the same error. When I upgraded to 2.2.5 (which is the oldest supported version at the time of this writing) then everything worked.

I also had to run gem install bundler after upgrading ruby. Last, I'm using rbenv and installed ruby with rbenv install 2.2.5 then ran rbenv local 2.2.5.

Jason
  • 11,709
  • 9
  • 66
  • 82
  • When I answer this question version 2.2.5 doesn´t exist. So my answer to this specific question at that time is correct. – Papaya Labs Apr 12 '17 at 12:47