DirectJRubyEmbedding无法加载OpenSSL

DirectJRubyEmbedding无法加载OpenSSL,openssl,jruby,Openssl,Jruby,我正在尝试使用DirectJRubyEmbedding为我的应用程序设置Java到Ruby的API调用。需要加载的ruby模块之一是active_支持。然后加载“securerandom”,然后加载“openssl” 在openssl中,digest.rb对此进行了重新定义 尝试使用OpenSSL gem会导致以下错误: 未初始化常量OpenSSL::摘要::OpenSSL\u版本号 org.jruby.RubyModule.const_缺失(org/jruby/RubyModule.java:

我正在尝试使用DirectJRubyEmbedding为我的应用程序设置Java到Ruby的API调用。需要加载的ruby模块之一是active_支持。然后加载“securerandom”,然后加载“openssl”

在openssl中,digest.rb对此进行了重新定义

尝试使用OpenSSL gem会导致以下错误:

未初始化常量OpenSSL::摘要::OpenSSL\u版本号

org.jruby.RubyModule.const_缺失(org/jruby/RubyModule.java:2677) 在RUBY.Digest(/Users/v/.rvm/gems/RUBY-1.9.3-p125/gems/jruby-openssl-0.8.2/lib/1.9/openssl/Digest.rb:24) 在RUBY.OpenSSL(/Users/v/.rvm/gems/RUBY-1.9.3-p125/gems/jruby-OpenSSL-0.8.2/lib/1.9/OpenSSL/digest.rb:22) 在RUBY.(root)上(/Users/v/.rvm/gems/RUBY-1.9.3-p125/gems/jruby-openssl-0.8.2/lib/1.9/openssl/digest.rb:21) 在org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027) 位于RUBY.(root)(/Users/v/.rvm/gems/RUBY-1.9.3-p125/gems/jruby-openssl-0.8.2/lib/1.9/openssl.rb:1) 在org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027) 在RUBY.(root)上(/Users/v/.rvm/gems/RUBY-1.9.3-p125/gems/jruby-openssl-0.8.2/lib/1.9/openssl.rb:20) 在org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027) 在RUBY.(root)上(/Users/v/.rvm/rubies/jruby-1.6.7.2/lib/RUBY/1.9/securerandom.rb:1) 在org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027) 在RUBY.(root)上(/Users/v/.rvm/rubies/jruby-1.6.7.2/lib/RUBY/1.9/securerandom.rb:37) 在org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027) 在RUBY.(root)上(/Users/v/.rvm/gems/RUBY-1.9.3-p125/gems/activesupport-3.2.9/lib/active_support.rb:1) 在org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027) 在RUBY.(root)上(/Users/v/.rvm/gems/RUBY-1.9.3-p125/gems/activesupport-3.2.9/lib/active_support.rb:24) 在org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027) 在RUBY.(root)上(/Users/v/.rvm/gems/RUBY-1.9.3-p125/gems/activesupport-3.2.9/lib/active\u support/all.rb:1)

我正在使用Ruby 1.9.3-p125和openssl 0.8.2,如下面的gem加载所示

.rvm/gems/ruby-1.9.3-p125/gems/jruby-openssl-0.8.2/lib/1.9

我注意到jirb显示:

1.9.3-p125:004>OpenSSL::OpenSSL\u版本号 =>9469999

因此,看起来JRuby.jar中的java编译类在OpenSSL模块中定义了它,但是.rb文件中的代码无法找到它

任何帮助都将不胜感激

谢谢

正如我提到的,你应该考虑RedBridge而不是<代码>直接JavaRub嵌入< /代码> .<