我使用Authlogic-Connect第三方登录。在运行适当的迁移后,Twitter/谷歌/yahoo登录似乎工作正常,但facebook登录抛出异常:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

开发日志显示

OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed):
  app/controllers/users_controller.rb:37:in `update'

请建议. .


当前回答

在Ruby 2.3.4中遇到这个问题:

我解了OpenSSL,然后重新安装。我跑:

酿造卸载——忽略依赖openssl

然后

安装openssl

它做到了。

其他回答

一行程序在Admin提示符中修复了Windows的问题

巧克力安装wget(第一次见chocolatey.org)

wget http://curl.haxx.se/ca/cacert.pem -O C:\cacert.pem && setx /M SSL_CERT_FILE "C:\cacert.pem"

或者这样做:

gem sources -r https://rubygems.org/
gem sources -a http://rubygems.org/

Milanio的方法:

gem sources -r https://rubygems.org
gem sources -a http://rubygems.org 
gem update --system
gem sources -r http://rubygems.org
gem sources -a https://rubygems.org

gem install [NAME_OF_GEM]

我在开发Ruby项目时遇到了同样的问题。我使用的是64bit的Windows 7。

我是这样解决的:

下载cacert。来自http://curl.haxx.se/ca/cacert.pem的Pem文件。 保存到C:/RubyCertificates/cacert.pem目录下 然后设置我的环境变量“SSL_CERT_FILE”为“C:\RubyCertificates\cacert.pem”

来源:https://gist.github.com/fnichol/867550

有时这并不总是rvm的问题 在MAC OSX中,如果你删除了.rvm,问题仍然存在(特别是当你从timemachine备份数据时),你可以尝试这种方式。

1.brew update
2.brew install openssl

如果你在/usr/local/etc/openssl中有一个指向cert.pem的符号链接,尝试这样做:

ruby -ropenssl -e "p OpenSSL::X509::DEFAULT_CERT_FILE" (should be /usr/local/etc/openssl)
cd /usr/local/etc/openssl
wget http://curl.haxx.se/ca/cacert.pem
ln -s cacert.pem 77ee3751.0 (77ee3751.0 is my symbolic link, should depend on the openssl version)

我通过在终端中运行这个解决了这个问题。完整的记录可以在这里找到

rvm install 2.2.0 --disable-binary