$ 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-
Looks like the problem is:
ossl_pkcs7.c:573:1: error: unknown type name ‘STACK’
My guess is its a dependancy issue.
Look at the output of:
rvm notes
And ensure you have followed all the steps for Ubuntu.
One obvious thing is that Ubuntu 11.10 is only just out - might be worth searching/posting on the Ubuntu forums to see if anyone there has had any issues with it and rvm.