I'm using Ubuntu Server 10 lucid, ruby 1.9.2-p0. In irb, the left arrow shows ^[[D
. Any idea?
Why does hitting the left arrow in irb give me "^[[D"?
...as opposed to what? At the very least you'll need a readline-aware irb I believe. –
Carducci
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). :) –
Kandace
@Kandace thanks for explain the details for me –
Gentille
You need to do:
sudo apt-get install libreadline-dev
and then reinstall ruby and irb.
Kind of a longshot, but do you have any sources on what causes this? On Ubuntu I had to install this package and recompile ruby to get up arrow to work. –
Unwatched
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.
In my case, I just needed to
rvm reinstall <ruby version>
. No other action needed regarding packages or anything else. –
Manda 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.
© 2022 - 2024 — McMap. All rights reserved.