It was ruining all my mood and concentration when i was trying some sample ruby code in irb and again and again i had to retype the things because the arrow keys were not working there. I searched the problem on net and found that i need to have readline library on my linux and in ruby as well. Now the point is readline should be available on the linux before you compile ruby so as you can give the readline option while compiling ruby. BUT we have ruby already installed !! Now What ?
Now, first you will need to install system based readline libraries as
sudo apt-get install libreadline5 libreadline5-dev
If you are not able to install linux based readline with the above method the refer this for more details.
Now you will need to compile the ruby based readline interface to let you readline library available in irb.
Do it by this…
cd /usr/local/src/ruby-1.8.6/ext/readline sudo ruby extconf.rb sudo make sudo make install
thats it, all done!!
Try your tips on arrow keys in irb, it should work now.