IRB Keyboard Input Issues

O

Oliver Saunders

When I press the up arrow in IRB to access history I see this:
^[[A

I'm running it over SSH with PuTTy but BASH history works just fine.
 
F

Frederick Cheung

When I press the up arrow in IRB to access history I see this:
^[[A

I'm running it over SSH with PuTTy but BASH history works just fine.

Is the ruby you've got on your remote server built with readline ?

Fred
 
O

Oliver Saunders

Is the ruby you've got on your remote server built with readline ?

It's 1.8.6, I used configure without any args when I built it.
 
T

Tammo Tjarks

Which OS are you using. On Solaris for example you have normally thsi
beahvior because readline is missing. You have to provide then first
readline and tell ruby that readline is avaiable (extend the Library path,
and I think there is a option --with-readline).

Regards,
Tammo
 
O

Oliver Saunders

Which OS are you using.
SSH from Windows to Ubuntu Linux
You have to provide then first readline and tell ruby that readline is
avaiable (extend the Library path, and I think there is a option
--with-readline).

Umm...come again.
 
O

Oliver Saunders

did you installed build dependencies for ruby?
sudo apt-get build-dep ruby1.8

I compiled it, I didn't install it from a package. If I was missing a
dependency I would have been told, surely? The compile was successful.
 
J

Joel VanderWerf

Oliver said:
I compiled it, I didn't install it from a package. If I was missing a
dependency I would have been told, surely? The compile was successful.

Look in ext/readline/. Does readline.o exist? If not, what does mkmf.log
say? Or, just run

ruby extconf.rb

in that dir and see if there are any failures.
 
Y

Yu-raku-an

Hi, this is Yu-raku-an,

Oliver said:
I compiled it, I didn't install it from a package. If I was missing a
dependency I would have been told, surely? The compile was successful.

I think it may be because you do not have the sources of readline
library in your development environment.
Install them via your package system or any other way,
(readline-devel.i386 package for 'yum' on CentOS, for example)
and and go to ext/readline/, run 'ruby extconf.rb'.

Thank you.
 
M

Marc Heiler

It's 1.8.6, I used configure without any args when I built it.

readline will only be built if ruby can find the header files. Many
distributions cripple the installation by not providing the headers by
default for various
arbitrary reasons.

Once you sorted this readline problem (you know, this apt-get hassle or
yum or rpm...), go to your extracted ruby archive.

Do
cd ext/readline; ruby extconf.rb; make

That should give you readline support in ruby (i think it will also
complain
if it encounters a problem therein)
I think there is a option --with-readline

Unfortunately there is not.
 
J

John Gregory

Pawel said:
That worked for me thx

I have had success too, with some slight additions to the above.

I have Ruby 1.9.1p129 and had the problem with the upward cursor key not
showing the previous keyboard input.

I had installed readline-devel in Yast (OpenSUSE 11.1) and that didn't
make a difference.

I then ran extconf.rb from its directory and noticed it built a
Makefile, so I ran 'make' and 'make install' with zero errors.

I then opened irb, entered some code, ran it, then pressed the 'up' key
and it displayed the code I had inputted.

Result!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top