compiling ruby with ssl support
Posted by andyh on Mar 14th, 2008
I’ve been making packages for Solaris i386 architecture recently and have been compiling ruby as it’s required by puppet - our excellent configuration management software.
I had no trouble compiling it and making a Solaris package but when I came to use it to install puppet I ran into this
-bash-3.00$ ruby install.rb DESTDIR=${DESTDIR}
Could not load openssl; cannot install
It seems that ruby hadn’t included the openssl files into it’s build.
I found a post that said that openssl wasn’t included in ubuntu by default and it could be installed manually, so I tried it and found out that it could not find a header file:
-bash-3.00$ cd ruby-1.8.6-p114/ext/openssl/ -bash-3.00$ ruby extconf.rb === OpenSSL for Ruby configurator === === Checking for system dependent stuff... === checking for t_open() in -lnsl... yes checking for socket() in -lsocket... yes 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.
A quick modify of the CFLAGS variable to add “-I” and a re-run of configure/make and ruby had openssl support built in.

