JRuby OpenSSL 错误

发布于 2024-09-10 06:54:44 字数 711 浏览 2 评论 0原文

我在配置 JRuby 使其与 OpenSSL 一起正常工作时遇到问题。谷歌搜索显示这是一种非常常见的情况,但我读过的解决方案都不适合我。这是我的设置:

  • Ubuntu 9.10
  • jruby 1.5.1
  • jruby-openssl (0.7)

这是错误:

irb(main):001:0> require 'jruby/openssl/gem_only'
=> true
irb(main):002:0> require 'openssl'
=> true
irb(main):003:0> OpenSSL::Digest::OPENSSL_VERSION_NUMBER
NameError: uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER

有趣的是,即使我没有安装 jruby-openssl gem, require 'openssl' 返回 true 。根据 此链接,这不应该发生吗?

尝试使用 require 'rubygems'gem 'jruby-openssl' 显式加载 gem 没有帮助。

I am having problems configuring JRuby to work properly with OpenSSL. Googling has revealed that this is a pretty common occurence, but none of the solutions I've read have worked for me. Here is my setup:

  • Ubuntu 9.10
  • jruby 1.5.1
  • jruby-openssl (0.7)

Here is the error:

irb(main):001:0> require 'jruby/openssl/gem_only'
=> true
irb(main):002:0> require 'openssl'
=> true
irb(main):003:0> OpenSSL::Digest::OPENSSL_VERSION_NUMBER
NameError: uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER

Interestingly, require 'openssl' returns true even if I don't have the jruby-openssl gem installed. According to this link, that shouldn't happen?

Trying to load the gem explictly with require 'rubygems' and gem 'jruby-openssl' doesn't help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最佳男配角 2024-09-17 06:54:44

您确定您正在寻找正确的常数吗?

$ ruby -v -r openssl -e 'p OpenSSL::Digest::OPENSSL_VERSION_NUMBER'
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
-e:1: uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER (NameError)

$ ruby -v -r openssl -e 'p OpenSSL::OPENSSL_VERSION_NUMBER'
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
9470159

$ jruby -v -r openssl -e 'p OpenSSL::OPENSSL_VERSION_NUMBER'
jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [x86_64-java]
9469999

Are you sure you are looking at the right constant?

$ ruby -v -r openssl -e 'p OpenSSL::Digest::OPENSSL_VERSION_NUMBER'
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
-e:1: uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER (NameError)

$ ruby -v -r openssl -e 'p OpenSSL::OPENSSL_VERSION_NUMBER'
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
9470159

$ jruby -v -r openssl -e 'p OpenSSL::OPENSSL_VERSION_NUMBER'
jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [x86_64-java]
9469999
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文