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

请建议. .


当前回答

最新的rubygem-update-2.6.7已经解决了这个问题。http://guides.rubygems.org/ssl-certificate-update/

其他回答

OSX的解决方案:

安装最新的RVM稳定版本

rvm get stable

使用RVM命令自动解析证书

rvm osx-ssl-certs update all

下面是用于调试的另一个选项。

请确保永远不要在任何生产环境中使用它,因为它首先就会抵消使用SSL的好处。只有在您的本地开发环境中才可以这样做。

require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

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

1.brew update
2.brew install openssl

我试着用brew安装curl-ca-bundle,但这个包已经没有可用的了:

$ brew install curl-ca-bundle
Error: No available formula for curl-ca-bundle 
Searching formulae...
Searching taps...

对我来说,Mac上的解决方案是:

 $ cd /usr/local/etc/openssl/certs/
 $ sudo curl -O http://curl.haxx.se/ca/cacert.pem

在~/中添加这一行。Bash_profile(或~/.)ZSHRC for zsh):

export SSL_CERT_FILE=/usr/local/etc/openssl/certs/cacert.pem

然后更新你的终端:

$ source ~/.bash_profile

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