捆绑安装失败并显示 SSL 证书验证错误 [英] bundle install fails with SSL certificate verification error
问题描述
当我在 Centos 5.5 上为我的 Rails 3 项目运行 bundle install
时,它失败并出现错误:
When I run bundle install
for my Rails 3 project on Centos 5.5 it fails with an error:
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3
read server certificate B: certificate verify failed
(https://bb-m.rubygems.org/gems/multi_json-1.3.2.gem)
An error occured while installing multi_json (1.3.2), and Bundler cannot continue.
Make sure that `gem install multi_json -v '1.3.2'` succeeds before bundling.
当我尝试手动安装 gem 时(通过 gem install multi_json -v '1.3.2'
)它可以工作.其他几个宝石也会出现同样的问题.我使用 RVM (1.12.3)、ruby 1.9.2、bundler 1.1.3.
When I try to install the gem manually (by gem install multi_json -v '1.3.2'
) it works. The same problem occurs with several other gems. I use RVM (1.12.3), ruby 1.9.2, bundler 1.1.3.
如何解决?
推荐答案
更新
既然我已经从这个答案中挖掘了足够的业力,每个人都应该知道这应该已经修复了.
Now that I've karma wh..err mined enough from this answer everyone should know that this should have been fixed.
re:再次通过 Ownatik 捆绑安装失败SSL 证书验证错误
re: via Ownatik again bundle install fails with SSL certificate verification error
gem update --system
我的答案仍然是正确的,如果最终对您不起作用,请留在下方以供参考.
My answer is still correct and left below for reference if that ends up not working for you.
老实说,最好的临时解决方案是
Honestly the best temporary solution is to
[...] 在您的 gemfile 中使用非 ssl 版本的 rubygems 作为临时解决方法.
[...] use the non-ssl version of rubygems in your gemfile as a temporary workaround.
通过用户Ownatik
via user Ownatik
它们的意思是在 Rails 应用程序目录更改中 Gemfile
的顶部
what they mean is at the top of the Gemfile
in your rails application directory change
来源'https://rubygems.org'
到
来源'http://rubygems.org'
注意第二个版本是http而不是https
note that the second version is http instead of https
这篇关于捆绑安装失败并显示 SSL 证书验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!