14
votes

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

3
...as opposed to what? At the very least you'll need a readline-aware irb I believe. - user166390
As for "why": Because that's what the raw command sequence looks like rendered as characters when the console does not specifically handle this key (for example by moving the cursor to the left). :) - deceze
@deceze thanks for explain the details for me - mko

3 Answers

14
votes

You need to do:

sudo apt-get install libreadline-dev

and then reinstall ruby and irb.

6
votes

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.

0
votes

IRB is installed with Ruby. I had this problem where it worked and then stopped working. I updated Ruby (rvm install ruby-) and it works again.