岩月と申します。

configure --disable-shared --with-static-linked-extをした後に作った 
rubyバイナリですが、以下のように拡張子が.soのリンク済みライブラリと同 
名のpure Rubyなライブラリをrequireできませんでした。

% ./ruby19cvs -I.ext -v -e "p($:, $\", require('openssl'))"
ruby 1.9.0 (2005-08-02) [i386-freebsd5.4]
["/mnt/.private/ruby/src/ruby-current/_build_/.ext", "/home/don/local/ 
ruby19cvs/lib/ruby/site_ruby/1.9", "/home/don/local/ruby19cvs/lib/ 
ruby/site_ruby/1.9/i386-freebsd5.4", "/home/don/local/ruby19cvs/lib/ 
ruby/site_ruby", "/home/don/local/ruby19cvs/lib/ruby/1.9", "/home/don/ 
local/ruby19cvs/lib/ruby/1.9/i386-freebsd5.4", "."]
["enumerator", "bigdecimal.so", "curses.so", "dbm.so", "digest.so",  
"digest/md5.so", "digest/rmd160.so", "digest/sha1.so", "digest/ 
sha2.so", "dl.so", "etc.so", "fcntl.so", "gdbm.so", "iconv.so", "io/ 
wait.so", "nkf.so", "openssl.so", "pty.so", "racc/cparse.so",  
"readline.so", "ripper.so", "sdbm.so", "socket.so", "stringio.so",  
"strscan.so", "syck.so", "syslog.so", "zlib.so"]
false

これは正しい状態でしょうか?

一応拡張子を明示すればrequireできるのを確認しています。

% ./ruby19cvs -I.ext -v -e "p(require('openssl.rb'))"
ruby 1.9.0 (2005-08-02) [i386-freebsd5.4]
true

また、$"から"openssl.so"を削除してもrequireできるようになります。実際 
には上記configureオプション有効時にはopenssl.so自体がありませんのでエ 
ラーになります。

% ./ruby19cvs -I.ext -I.ext/i386-freebsd5.4 -v -e "$\".delete 
('openssl.so'); p(require('openssl'))"
ruby 1.9.0 (2005-08-02) [i386-freebsd5.4]
/mnt/.private/ruby/src/ruby-current/_build_/.ext/openssl.rb:17:in  
`require': no such file to load -- openssl.so (LoadError)
         from /mnt/.private/ruby/src/ruby-current/_build_/.ext/ 
openssl.rb:17
         from -e:1


もともとは現在上記configureオプション有効時にmake test-allをすると以下 
のようなエラーが出ているために調べていたところ、上記のような症状がわか 
りました。

% make AUTOCONF=autoconf259 test-all
./miniruby ../runruby.rb --extout=.ext -- -C "../test" runner.rb -- 
runner=console
/mnt/.private/ruby/src/ruby-current/lib/drb/ssl.rb:83:in  
`setup_certificate': undefined method `create_extension' for  
#<OpenSSL::X509::ExtensionFactory:0x860f474> (NoMethodError)
         from /mnt/.private/ruby/src/ruby-current/lib/drb/ssl.rb: 
148:in `open_server'
         from /mnt/.private/ruby/src/ruby-current/lib/drb/drb.rb: 
756:in `open_server'
         from /mnt/.private/ruby/src/ruby-current/lib/drb/drb.rb: 
754:in `open_server'
         from /mnt/.private/ruby/src/ruby-current/lib/drb/drb.rb: 
1336:in `initialize'
         from /mnt/.private/ruby/src/ruby-current/test/drb/ 
test_drbssl.rb:33
         from /mnt/.private/ruby/src/ruby-current/lib/test/unit/ 
collector/dir.rb:83:in `collect_file'
         from /mnt/.private/ruby/src/ruby-current/lib/test/unit/ 
collector/dir.rb:66:in `recursive_collect'
         from /mnt/.private/ruby/src/ruby-current/lib/test/unit/ 
collector/dir.rb:51:in `recursive_collect'
         from /mnt/.private/ruby/src/ruby-current/lib/test/unit/ 
collector/dir.rb:56:in `recursive_collect'
         from /mnt/.private/ruby/src/ruby-current/lib/test/unit/ 
collector/dir.rb:51:in `recursive_collect'
         from /mnt/.private/ruby/src/ruby-current/lib/test/unit/ 
collector/dir.rb:26:in `collect'
         from /mnt/.private/ruby/src/ruby-current/lib/test/unit/ 
autorunner.rb:67
         from /mnt/.private/ruby/src/ruby-current/lib/test/unit/ 
autorunner.rb:198:in `run'
         from /mnt/.private/ruby/src/ruby-current/lib/test/unit/ 
autorunner.rb:13:in `run'
         from runner.rb:9
*** Error code 1


以上です。直し方はわかりませんので報告だけですが、よろしくお願いいたし 
ます。

-- 
岩月博之 <URL:mailto:don / na.rim.or.jp>