I came across the error: no such file to load — openssl when compiling ruby 1.8.7 from source. The ubuntu apt package lib-openssl-ruby is currently not up to date enough to work with ruby 1.8.7
To fix this, you need to reconfigure and reinstall your ruby source package with openssl included. You can do this with the following command:
./configure --prefix=/usr/local --with-openssl-dir=/usr --with-readline-dir=/usr --with-zlib-dir=/usr
Then do a make and make install
This has included openssl and you should no longer get the error!