3

Possible Duplicate:
bundle install fails with SSL certificate verification error

I have a problem whith bundle install. He isn't work.
Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.8'

gem 'sqlite3'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  gem 'uglifier', '>= 1.0.3'
end

gem "jquery-rails", "~> 2.1.3"

When I execute the command bundle install I received:

D:\ruby\work\myPage>bundle install
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.0.3)
Using activemodel (3.2.8)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.8)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.11)
Using mail (2.4.4)
Using actionmailer (3.2.8)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.8)
Using activeresource (3.2.8)
Using bundler (1.2.1)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)

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

Then I try start server rails server:

D:\ruby\work\myPage>rails server
←[31mCould not find gem 'sqlite3 (>= 0) x86-mingw32' in the gems available on this machine.←[0m
←[33mRun `bundle install` to install missing gems.←[0m

In what could be the problem? And how to solve it?

Community
  • 1
  • 1
John Smith
  • 85
  • 1
  • 1
  • 5

3 Answers3

7

This is because of a bug in your version of rubygems.

You can either run

gem update --system

Or, remove the s from your sources in your gemfile, like so:

source 'http://rubygems.org'
Brad Werth
  • 17,411
  • 10
  • 63
  • 88
  • HTTPS is only one layer of security, but dropping that S is usually irresponsible. Needs said. Bad idea, long term. – Alan H. Oct 22 '13 at 03:43
  • Yeah, we wouldn't want our gem requests to go out in plaintext... – Brad Werth Oct 22 '13 at 04:05
  • 1
    Brad, the concern isn’t that someone will see what gems you are using, but that it opens you up for a man-in-the-middle attack, in which someone could supply a doctored gem with, say, a backdoor that gives someone access to your database. Likely? No, but why would you want that possibility? (Anyway, best practice is to host gems yourself if you want reliable deploys, but that’s a separate concern.) – Alan H. Oct 22 '13 at 21:58
1

I solved the problem. I completely remove the Ruby. And reinstall it.

John Smith
  • 85
  • 1
  • 1
  • 5
  • I updated from OSX 10.7 to 10.9 and had exactly the same problem. Reinstalling the Ruby was the only thing that fixed it. – Evan Larkin Oct 25 '13 at 16:25
  • I want to undo my downvote, but Stack Overflow says my vote is “locked.” I think I downvoted because I did not want this to be the top answer, since it is not the best answer if anything else works (which — they do), but it’s still helpful. – Alan H. Oct 30 '13 at 06:32
0

explanation for this error can be found here

http://railsapps.github.com/openssl-certificate-verify-failed.html

check you ruby version and you rubygems version

then use gem update --system to fix it

Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244