Step 1: Install readline.
1 curl -O ftp://ftp.cwru.edu/pub/bash/readline-6.0.tar.gz
2 tar -xvzf readline-6.0.tar.gz
3 cd readline-6.0
4 ./configure
5 make
6 sudo make install
Step 2: Install Ruby 1.8.7
rvm install 1.8.7 -C --enable-shared,--with-readline-dir=/usr/local