Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does hitting the left arrow in irb give me "^[[D"?

Tags:

ruby

irb

I'm using Ubuntu Server 10 lucid, ruby 1.9.2-p0. In irb, the left arrow shows ^[[D. Any idea?

like image 864
mko Avatar asked Dec 27 '11 07:12

mko


2 Answers

You need to do:

sudo apt-get install libreadline-dev

and then reinstall ruby and irb.

like image 53
sawa Avatar answered Oct 31 '22 00:10

sawa


Alternatively, if you are using RVM, just remember to install readline:

rvm pkg install readline
rvm install 1.9.3 --with-readline-dir=$rvm_path/usr

Over the apt package, this has the advantage of giving you the 1.9.3 version, which IMHO is more stable.

like image 33
p4010 Avatar answered Oct 30 '22 23:10

p4010