From: Kazuhiro NISHIYAMA Date: 2011-12-22T00:32:19+09:00 Subject: [ruby-dev:45022] [ruby-trunk - Bug #5786] LoadError: cannot load such file -- openssl Issue #5786 has been updated by Kazuhiro NISHIYAMA. % git grep -n 'autoload.*openssl' lib/net/http.rb:24:autoload :OpenSSL, 'openssl' % で autoload が設定されていて、 lib/securerandom.rb:59: if defined? OpenSSL::Random の defined? で LoadError になってしまうのが原因のようです。 autoload と defined? の組み合わせは以下のようにバージョン毎に微妙に挙動が違うようです。 % cat /tmp/test.rb autoload :OpenSSL, 'openssl' p defined?(OpenSSL) p defined?(OpenSSL::Random) % ./ruby -v /tmp/test.rb ruby 1.8.7 (2011-12-10 patchlevel 356) [x86_64-linux] "constant" "constant" % cd $(\ls -1d /home/chkbuild/tmp/build/ruby-1.9.2/*|tail -n1)/bin % ./ruby -v /tmp/test.rb ruby 1.9.2p312 (2011-12-18 revision 34062) [x86_64-linux] nil nil % cd $(\ls -1d /home/chkbuild/tmp/build/ruby-1.9.3/*|tail -n1)/bin % ./ruby -v /tmp/test.rb ruby 1.9.3p6 (2011-12-20 revision 34080) [x86_64-linux] "constant" "constant" % cd $(\ls -1d /home/chkbuild/tmp/build/ruby-trunk/*|tail -n1)/bin % ./ruby -v /tmp/test.rb ruby 2.0.0dev (2011-12-21 trunk 34088) [x86_64-linux] "constant" "constant" % ---------------------------------------- Bug #5786: LoadError: cannot load such file -- openssl https://bugs.ruby-lang.org/issues/5786 Author: Kazuhiro NISHIYAMA Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0dev (2011-12-21 trunk 34091) [x86_64-linux] openssl がビルドされていないと test-all で LoadError: cannot load such file -- openssl になっていくつかエラーになります。 途中で Ctrl+C で止めてしまっているのでもっと出るのかもしれません。 test_cgi_session_filestore(CGISessionTest): LoadError: cannot load such file -- openssl .../ruby/lib/securerandom.rb:59:in `random_bytes' .../ruby/lib/securerandom.rb:140:in `hex' .../ruby/lib/cgi/session.rb:173:in `create_new_id' .../ruby/lib/cgi/session.rb:267:in `initialize' .../ruby/test/cgi/test_cgi_session.rb:33:in `new' .../ruby/test/cgi/test_cgi_session.rb:33:in `test_cgi_session_filestore' 2) Error: test_cgi_session_pstore(CGISessionTest): LoadError: cannot load such file -- openssl .../ruby/lib/securerandom.rb:59:in `random_bytes' .../ruby/lib/securerandom.rb:140:in `hex' .../ruby/lib/cgi/session.rb:173:in `create_new_id' .../ruby/lib/cgi/session.rb:267:in `initialize' .../ruby/test/cgi/test_cgi_session.rb:71:in `new' .../ruby/test/cgi/test_cgi_session.rb:71:in `test_cgi_session_pstore' 3) Error: test_cgi_session_specify_session_key(CGISessionTest): LoadError: cannot load such file -- openssl .../ruby/lib/securerandom.rb:59:in `random_bytes' .../ruby/lib/securerandom.rb:140:in `hex' .../ruby/lib/cgi/session.rb:173:in `create_new_id' .../ruby/lib/cgi/session.rb:267:in `initialize' .../ruby/test/cgi/test_cgi_session.rb:148:in `new' .../ruby/test/cgi/test_cgi_session.rb:148:in `test_cgi_session_specify_session_key' 4) Error: test_https_proxy_authentication(HTTPSProxyTest): LoadError: cannot load such file -- openssl .../ruby/test/net/http/test_https_proxy.rb:16:in `block (2 levels) in test_https_proxy_authentication' 5) Error: test_ssl_socket_close_on_post_connection_check_fail(Net::TestSSLSocket): LoadError: cannot load such file -- openssl .../ruby/lib/net/smtp.rb:197:in `default_ssl_context' .../ruby/lib/net/smtp.rb:345:in `enable_starttls_auto' .../ruby/test/net/smtp/test_ssl_socket.rb:51:in `test_ssl_socket_close_on_post_connection_check_fail' 6) Error: test_ssl_socket_open_on_post_connection_check_success(Net::TestSSLSocket): LoadError: cannot load such file -- openssl .../ruby/lib/net/smtp.rb:197:in `default_ssl_context' .../ruby/lib/net/smtp.rb:345:in `enable_starttls_auto' .../ruby/test/net/smtp/test_ssl_socket.rb:67:in `test_ssl_socket_open_on_post_connection_check_success' -- http://redmine.ruby-lang.org