3

可能重复:
捆绑安装失败并出现 SSL 证书验证错误

我有一个问题bundle install。他不是工作。
宝石文件:

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

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

4

3 回答 3

7

这是因为您的 ruby​​gems 版本中存在错误。

您可以运行

gem update --system

或者,从 gemfile 中的源中删除 s,如下所示:

source 'http://rubygems.org'
于 2012-10-12T22:31:51.907 回答
1

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

于 2012-10-14T09:01:34.307 回答
0

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

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

检查你的 ruby​​ 版本和你的 ruby​​gems 版本

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

于 2012-10-12T22:34:55.107 回答