$ rvm install ruby-1.8.7-p249 Installing Ruby from source to: /home/sayuj/.rvm/rubies/ruby-1.8.7-p249, this may take a while depending on your cpu(s)... ruby-1.8.7-
Be sure to install ruby with rvm and giving the open-ssl-dir explicitly like this:
rvm cleanup rvm install ruby-1.8.7 --with-openssl-dir=$HOME/.rvm/usr