gpt4 book ai didi

ruby - jruby 1.6.7/1.7.0 1.9 模式下的 OpenSSL::SSL::SSLError

转载 作者:数据小太阳 更新时间:2023-10-29 07:56:44 24 4
gpt4 key购买 nike

我在 1.9 模式下运行带有 jruby 1.7.0 的 Rails 3 应用程序,当我的一个文件上传 gem 尝试建立 https 连接时,它失败并出现以下异常:

Excon::Errors::SocketError: write would raise (OpenSSL::SSL::SSLError)
from org/jruby/ext/openssl/SSLSocket.java:626:in `syswrite_nonblock'
from /home/x/.rvm/gems/jruby-1.7.0@global/gems/jruby-openssl-0.7.7/lib/1.9/openssl/buffering.rb:375:in `write_nonblock'
from /home/x/.rvm/gems/jruby-1.7.0/gems/excon-0.16.7/lib/excon/socket.rb:139:in `write'
from /home/x/.rvm/gems/jruby-1.7.0/gems/excon-0.16.7/lib/excon/ssl_socket.rb:84:in `write'
from /home/x/.rvm/gems/jruby-1.7.0/gems/excon-0.16.7/lib/excon/connection.rb:243:in `request_kernel'
from /home/x/.rvm/gems/jruby-1.7.0/gems/excon-0.16.7/lib/excon/connection.rb:103:in `request'
from /home/x/.rvm/gems/jruby-1.7.0/gems/fog-1.7.0/lib/fog/core/connection.rb:20:in `request'
from /home/x/.rvm/gems/jruby-1.7.0/gems/fog-1.7.0/lib/fog/rackspace.rb:71:in `authenticate'
from /home/x/.rvm/gems/jruby-1.7.0/gems/fog-1.7.0/lib/fog/rackspace/storage.rb:146:in `authenticate'
from /home/x/.rvm/gems/jruby-1.7.0/gems/fog-1.7.0/lib/fog/rackspace/storage.rb:95:in `initialize'
from /home/x/.rvm/gems/jruby-1.7.0/gems/fog-1.7.0/lib/fog/core/service.rb:68:in `new'
from /home/x/.rvm/gems/jruby-1.7.0/gems/fog-1.7.0/lib/fog/storage.rb:34:in `new'
from /home/x/.rvm/gems/jruby-1.7.0/gems/carrierwave-0.6.2/lib/carrierwave/storage/fog.rb:106:in `connection'
from /home/x/.rvm/gems/jruby-1.7.0/gems/carrierwave-0.6.2/lib/carrierwave/storage/fog.rb:323:in `connection'
from /home/x/.rvm/gems/jruby-1.7.0/gems/carrierwave-0.6.2/lib/carrierwave/storage/fog.rb:335:in `directory'
from /home/x/.rvm/gems/jruby-1.7.0/gems/carrierwave-0.6.2/lib/carrierwave/storage/fog.rb:250:in `store'

我在 stackoverflow 上发现了一个类似的问题:JRuby Heroku Gem ,但建议的答案是在 1.8 模式下运行 jruby,我不能这样做,因为我们的整个应用程序使用 1.9 功能和语法。是否有人对如何修复或绕过此异常有任何想法或建议?

谢谢。

最佳答案

好的,这是我的 hacky 解决方案:

由于这是一个 Rails 项目,我创建了一个名为 excon_hack.rb 的文件并将其放在 initializers 文件夹中。

module Excon
DEFAULT_NONBLOCK = false
end

这会造成连接阻塞,这对我来说无关紧要,更重要的是,它修复了我的错误。

关于ruby - jruby 1.6.7/1.7.0 1.9 模式下的 OpenSSL::SSL::SSLError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13277774/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com