【问题标题】:Gem::RemoteFetcher::FetchError - certificate verify failed during bundle install [duplicate]Gem::RemoteFetcher::FetchError - 捆绑安装期间证书验证失败 [重复]
【发布时间】:2012-10-03 18:29:14
【问题描述】:

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

我对@9​​87654322@ 有疑问。他没有工作。
宝石文件:

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

可能是什么问题?又该如何解决呢?

【问题讨论】:

  • @cdesrosiers "rails server" 仍然无法正常工作
  • 如果由于sqlite3 gem 仍然失败,请确保您的机器上安装了 sqlite db。

标签: ruby-on-rails rubygems bundler


【解决方案1】:

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

【讨论】:

  • 我从 OSX 10.7 更新到 10.9 并且遇到了完全相同的问题。重新安装 Ruby 是唯一能解决此问题的方法。
  • 我想撤销我的反对票,但 Stack Overflow 说我的投票已“锁定”。我认为我投了反对票,因为我不希望这是最佳答案,因为如果其他方法有效(它们确实有效),这不是最佳答案,但它仍然有帮助。
【解决方案2】:

这个错误的解释可以在这里找到

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

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

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

【讨论】:

  • 我执行了gem update --system,但每当我运行bundle 时,此错误仍然存​​在。我的 gem -v 是 2.1.9,甚至比 ruby​​gems.org 上的下载链接(当前为 2.1.7)更新。什么?
  • 你的 ruby​​gems 版本比最新版本更新吗??
  • 我认为他们更新网站的速度很慢。
  • 不确定.. 可能要检查您的安装
【解决方案3】:

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

你可以运行

gem update --system

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

source 'http://rubygems.org'

【讨论】:

  • HTTPS 只是一层安全性,但放弃 S 通常是不负责任的。需要说。坏主意,长期。
  • 是的,我们不希望我们的 gem 请求以明文形式发出...
  • 布拉德,担心的不是有人会看到你正在使用什么宝石,而是它为你打开了中间人攻击的大门,在这种攻击中,有人可以提供经过修改的宝石比如说,一个后门可以让某人访问您的数据库。可能吗?不,但你为什么想要这种可能性? (无论如何,如果您想要可靠的部署,最佳实践是自己托管 gem,但这是一个单独的问题。)
猜你喜欢
  • 1970-01-01
  • 2015-06-05
  • 1970-01-01
  • 1970-01-01
  • 2012-05-02
  • 2018-10-14
  • 1970-01-01
  • 2014-12-03
  • 1970-01-01
相关资源
最近更新 更多