If you have installed ruby using apt-get or if you have not mentioned the configuration option for openssl while installing from source, you can expect openssl will not work with ruby.
Here is the solution for the same…
Install gcc and make(if you don’t have already on your box)
sudo apt-get install gcc make
Install the system level OpenSSL and dev libraries
sudo apt-get install openssl libssl-dev
Install the ruby’s openssl interface to the system’s openssl
switch the directory to the ruby’s source code’s openssl
install the ruby’s openssl interface
sudo ruby extconf.rb make make install
try requiring the openssl in irb
if returns true, installed successfully!