Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jruby 1.6.7/1.7.0 1.9模式下的OpenSSL::SSL::SSLError_Ruby_Ruby On Rails 3_Jruby_Jruby Openssl - Fatal编程技术网

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

jruby 1.6.7/1.7.0 1.9模式下的OpenSSL::SSL::SSLError,ruby,ruby-on-rails-3,jruby,jruby-openssl,Ruby,Ruby On Rails 3,Jruby,Jruby Openssl,我正在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/jru

我正在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上发现了一个类似的问题:,但建议的答案是在1.8模式下运行jruby,这是我无法做到的,因为我们的整个应用程序使用1.9功能和语法。有没有人对如何修复或绕过此异常有任何想法或建议


谢谢。

好的,下面是我的黑客解决方案:

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

module Excon
  DEFAULT_NONBLOCK = false
end

这会造成连接块,这对我来说并不重要,更重要的是,它修复了我的错误。

另一个选择是将jruby openssl降级为0.7.4。我还不清楚这是否有效地将excon恢复到阻塞模式,或者只是让非阻塞工作。

Russ,查看我刚刚发布的解决方案。jruby开发人员告诉我,非阻塞问题在jruby 1.7.1-dev中得到了修复,但还没有机会测试该断言。