Gem :: RemoteFetcher :: FetchError - 软件包安装期间证书验证失败

时间:2012-10-12 21:47:16

标签: ruby-on-rails rubygems bundler

  

可能重复:
  bundle install fails with SSL certificate verification error

我遇到问题bundle install。他不工作 的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"

当我执行命令bundle install时,我收到了:

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.

然后我尝试启动服务器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

可能是什么问题?以及如何解决?

3 个答案:

答案 0 :(得分:7)

这是因为您的rubygems版本中存在错误。

您可以运行

gem update --system

或者,从gem文件中的源代码中删除s,如下所示:

source 'http://rubygems.org'

答案 1 :(得分:1)

我解决了这个问题。我完全删除了Ruby。然后重新安装。

答案 2 :(得分:0)

可以在此处找到此错误的解释

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

检查ruby版本和rubygems版本

然后使用gem update --system来修复它