ruby-openssl のインスコ問題は1行でイナフだった

Twitter4Rを使おうとしたら呼び出したとき(require 'twitter')に

no such file to load -- openssl
と出た。OSはCentOS5、Rubyは1.8.6。なぜか ruby-openssl がインスコされていなかったようなので

を参考にインスコしたときのRubyのソースを使って

$ cd ruby-1.8.6/ext/openssl
$ ruby extconf.rb
$ make
# make install
とするはずが「ruby extconf.rb」のところでエラーが出た。

=== OpenSSL for Ruby configurator ===
=== Checking for system dependent stuff... ===
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
=== Checking for required stuff... ===
checking for openssl/ssl.h... no
=== Checking for required stuff failed. ===
Makefile wasn't created. Fix the errors above.
*** ext/openssl/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=ext/openssl
--curdir
--ruby=/usr/local/bin/ruby
--with-openssl-dir
--without-openssl-dir
--with-openssl-include
--without-openssl-include=${openssl-dir}/include
--with-openssl-lib
--without-openssl-lib=${openssl-dir}/lib
--with-kerberos-dir
--without-kerberos-dir
--with-kerberos-include
--without-kerberos-include=${kerberos-dir}/include
--with-kerberos-lib
--without-kerberos-lib=${kerberos-dir}/lib
--with-debug
--without-debug
--enable-debug
--disable-debug
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config

とりあえずログを見る。
 have_library: checking for t_open() in -lnsl... -------------------- no
"gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/i686-linux -I. -g -O2 conftest.c -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -rdynamic -Wl,-export-dynamic -lruby-static -lnsl -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:3: error: ‘t_open’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))t_open; return 0; }
/* end */

"gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/i686-linux -I. -g -O2 conftest.c -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -rdynamic -Wl,-export-dynamic -lruby-static -lnsl -ldl -lcrypt -lm -lc"
/tmp/ccWAAE9d.o: In function `t':
/root/ruby-1.8.6-p111/ext/openssl/conftest.c:3: undefined reference to `t_open'
collect2: ld はステータス 1 で終了しました
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { t_open(); return 0; }
/* end */

さっぱり分からない。2時間ほどいろいろ試したけど結局は
yum install openssl-devel
openssl-devel を入れてやれば件の問題は解決し、その後の make も無事行えた。2時間悩んだことが1行で解決してしまいそれはそれで悔しい、という話。