Enabling readline support in 1.9.0?

Hello,

I installed ruby 1.8.2 and irb as Kubuntu packages, but ran into problems with threading. The solution was to grab ruby from CVS, so now I'm running the stable snapshot of 1.9.0.

I notice that up arrow no longer works to scroll back through the command history in irb. My suspicion is that I have compiled Ruby without readline support. When I try to require 'irb/completion', I get this error:

irb(main):001:0> require 'irb/completion'
LoadError: no such file to load -- readline
        from /usr/local/lib/ruby/1.9/irb/completion.rb:10:in `require'
        from /usr/local/lib/ruby/1.9/irb/completion.rb:10
        from (irb):1:in `irb_binding'
        from /usr/local/lib/ruby/1.9/irb/workspace.rb:52:in `irb_binding'
        from /usr/local/lib/ruby/1.9/irb/workspace.rb:52
Maybe IRB bug!!

I suspect ruby rather than irb because removing the irb package and reinstalling it has no effect. Does this sound likely? If so, how do I enable readline support?

Thanks,

-dB

···

--
David Brady
ruby-talk@shinybit.com
I'm having a really surreal day... OR AM I?

Hi,

At Sat, 9 Jul 2005 10:50:00 +0900,
David Brady wrote in [ruby-talk:147622]:

I installed ruby 1.8.2 and irb as Kubuntu packages, but ran into
problems with threading. The solution was to grab ruby from CVS, so now
I'm running the stable snapshot of 1.9.0.

1.9.0 is not a "stable" version. You would mean the "latest"
snapshot.

I suspect ruby rather than irb because removing the irb package and
reinstalling it has no effect. Does this sound likely? If so, how do I
enable readline support?

ext/readline/extconf.rb apparently failed to detect readline
library. Can't you show the mkmf.log file in that directory?

···

--
Nobu Nakada

David Brady wrote:

Hello,

I installed ruby 1.8.2 and irb as Kubuntu packages, but ran into
problems with threading. The solution was to grab ruby from CVS, so now
I'm running the stable snapshot of 1.9.0.

Stable snapshot currently means 1.8 ... Snapshot is 1.9

I take it you're on 1.9 so you probably have readline.so in
  lib/ruby/1.8/ix86-xxxxxxxx
.... but not in
  lib/ruby/1.9/ix86-xxxxxxxx

irb(main):001:0> require 'irb/completion'
LoadError: no such file to load -- readline

Maybe IRB bug!!

Nooo, never.

I suspect ruby rather than irb because removing the irb package and
reinstalling it has no effect. Does this sound likely? If so, how do I
enable readline support?

Install it for 1.9 ?
You could try copying to the 1.9 dir if you enjoy taking risks :wink:

daz

1.9.0 is not a "stable" version. You would mean the "latest"
snapshot.

Errrrk! I am very new to Ruby, and I appear to have wandered off the path and been eaten by bears.

I was advised (in an earlier thread on this list) to get the latest tcltklib.c from CVS. I am rather clumsy at building projects under linux, however, so I probably did something wrong. Ohh, I know what it was: I grabbed the latest stable (1.8.2), and its README gave instructions on how to "get it from anonymous CVS". I did *that*, which appears to have given me 1.9.0.

So. Um. Is my Ruby now unstable? Wheee!

I guess I should have thought more carefully about what I was originally advised to do: I should have gotten the 1.9.0 sources, copied just tcltklib.c into the 1.8.2 sources, and built *that*.

...I think. Heh. Every day's a new adventure with Ruby.

ext/readline/extconf.rb apparently failed to detect readline
library. Can't you show the mkmf.log file in that directory?

Ah! Now there's a file with some useful information in it! (Nevermind RTFM, my problem is KTTFMEE: Knowing That The F(antastic) Manual Even Exists.)

I think the beginnings of my problem are right at the beginning of the log, in:

have_library: checking for tgetnum() in -lncurses... -------------------- no

"gcc -o conftest -I../.. -I../../. -g -O2 conftest.c -L'../..' -lruby-static -lncurses -lpthread -ldl -lcrypt -lm -lc"
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status

The entire log is posted here:

http://www.shinybit.com/readline_mkmf.log

I am going to try to fall back to the 1.8.2 build (with the upgraded tcltklib.c). Any advice on this issue would still be appreciated, however. I don't see how 1.8.2 will be able to find ncurses if 1.9.0 couldn't. Keep in mind that I have installed most of my packages using Kubuntu's apt. There's no telling what I'm missing.

Thanks,

-dB

···

nobu.nokada@softhome.net wrote:

--
David Brady
ruby-talk@shinybit.com
I'm having a really surreal day... OR AM I?

Hi,

At Sun, 10 Jul 2005 03:44:12 +0900,
David Brady wrote in [ruby-talk:147672]:

The entire log is posted here:

http://www.shinybit.com/readline_mkmf.log

Have you installed the headers of readline? Maybe
readline-devel package or something else?

···

--
Nobu Nakada

That worked!

I installed libreadline5-dev and it's dependency, libncurses5-dev. Ruby compiles happily now, and irb gives readline support.

Thank you,

-dB

···

nobu.nokada@softhome.net wrote:

Have you installed the headers of readline? Maybe
readline-devel package or something else?

--
David Brady
ruby-talk@shinybit.com
I'm having a really surreal day... OR AM I?