5

我收到此错误消息:

twitter/rest/client.rb:96:in 'rescue in request' ssl_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (Twitter::Error)

我的代码是:

require 'twitter'
client = Twitter::REST::Client.new do |config|
  config.consumer_key        = "xxxx" #removed for posting
  config.consumer_secret     = "xxxx" #removed for posting
  config.access_token        = "xxxx" #removed for posting
  config.access_token_secret = "xxxx" #removed for posting
end
client.status(27558893223)

我正在使用 Windows 7 和 Ruby 1.9.3。我已经安装了最新的证书并将我的 ruby​​ gem 更新到了最新版本。

我已经尝试过http://railsapps.github.io/openssl-certificate-verify-failed.htmlhttps://gist.github.com/fnichol/867550并且已经能够安装那里提到的所有内容,但是错误持续存在。

4

1 回答 1

3

这就是你解决这个问题的方法是 Windows

首先下载 .perm 文件,然后在命令提示符中设置 SSL_CERT_FILE,如下所示: SSL_CERT_FILE=C:\my_path\to.pem

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

于 2014-07-29T20:27:19.013 回答