From: Hiroshi Nakamura Date: 2011-12-22T07:24:56+09:00 Subject: [ruby-dev:45024] Re: [ruby-trunk - Bug #5786] LoadError: cannot load such file -- openssl On Thu, Dec 22, 2011 at 00:32, Kazuhiro NISHIYAMA wrote: > % git grep -n 'autoload.*openssl' > lib/net/http.rb:24:autoload :OpenSSL, 'openssl' > % > で autoload が設定されていて、 > lib/securerandom.rb:59: if defined? OpenSSL::Random > の defined? で LoadError になってしまうのが原因のようです。 なるほどー。いいバグですねえ。net/http.rbがOpenSSLをautoloadにしているので、net/http.rb経由でOpenSSLを触るテストは落ちるし、securerandom.rbもif defined? OpenSSL::RandomのOpenSSL定数アクセスで落ちてしまう、ということでしょうか。 で、どうしますかね。opensslなしでもテスト通ったほうがいい? > autoload と defined? の組み合わせは以下のようにバージョン毎に微妙に挙動が違うようです。 詳しく見てませんが、opensslがインストールしてあるかどうかの差だったりします? == For Martin (emboss): He said he got test failures when ossl was not built. net/http.rb defined autoload for OpenSSL so tests that depend net/http.rb would try to load openssl via OpenSSL access then fail. Tests that depend securerandom.rb also fails by 'if defined? OpenSSL::Random', too. Also, 'if defined? OpenSSL' guards in test/openssl would not work as expected. Anyways, it's not the bug of ossl but of the build system, and not severe.