I am using osx 10.8.2 installed ruby 2.0 and.... got this when trying to run \"sudo gem install rails\"
$
I fix this error for ruby 2.1.2 as follow.
rvm pkg install openssl rvm reinstall ruby-2.1.2 --with-openssl-dir=$rvm_path/usr