我使用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'

请建议. .


当前回答

对我来说最直接的答案是

sudo apt-get install openssl ca-certificates

瞧! !

其他回答

这招对我很管用

rvm pkg install openssl
rvm reinstall 1.9.2 --with-openssl-dir=$rvm_path/usr

我的ubuntu 12.04的openssl实现有问题

以下是如何在Windows上修复它:https://gist.github.com/867550(由Fletcher Nichol创建)

摘录:

手工方式(无聊) 下载cacert。来自http://curl.haxx.se/ca/cacert.pem的Pem文件。将文件保存到C:\RailsInstaller\cacert.pem。 现在,通过设置SSL_CERT_FILE,让ruby知道您的证书颁发机构包。要在当前命令提示符会话中设置此选项,输入: 设置SSL_CERT_FILE = C: \ RailsInstaller \ cacert.pem 要使此设置为永久设置,请在控制面板中添加此设置。

在Ubuntu上安装以下包为我解决了这个问题

Sudo apt-get安装libssl-dev

一行程序在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]

对我来说,有效的答案是:

# Reinstall OpenSSL
brew update
brew remove openssl
brew install openssl
# Download CURL CA bundle
cd /usr/local/etc/openssl/certs
wget http://curl.haxx.se/ca/cacert.pem
/usr/local/opt/openssl/bin/c_rehash
# Reinstall Ruby from source
rvm reinstall 2.2.3 --disable-binary