From: Michal Suchanek Date: 2011-01-09T20:17:32+09:00 Subject: Re: ripl - an irb alternative - 0.3.0 released On 8 January 2011 16:40, Gabriel Horner wrote: > Michal Suchanek wrote in post #973296: >> On 8 January 2011 06:10, ghorner wrote: >>> On Jan 7, 5:18 am, Michal Suchanek wrote: >>>> On 7 January 2011 10:55, ghorner wrote: >>>> >> >>>> >>>> >> > correctly, then the problem must be you can't find it. What does the >>>> > It reports a missing readline.h: >>>> versioned readline shared library is always installed as dependecy of >>>> many packages). >>>> >>> >>> Unfortunately, none of this helps but to illustrate what you've >>> already said. If 5.2 is the readline version you're using, you should >>> consider upgrading. I'm on readline 6.1 and have only used bond with >>> readline >= 5.6. >> >> >>> debian is possibly placing it outside the gem's directory. >> As expected >> /var/lib/gems/1.8/gems/bond-0.3.5/lib/readline_line_buffer.so >> >> is present only in the case when libreadline5-dev was present while >> installing the bond gem. >> >> However, there is no difference in the dem install output. >> >> So bond does not report any error to the user when the library is not >> found, and it finds it just fine when it is installed. >> >> Searching for the file does no help but to illustrate what I have >> already seen. Bond silently installs broken extension when readline >> development files are not present. Perhaps you should fail the build >> when readline is not available but the Ruby interpreter does not >> provide it or you should print the message to standard error rather >> than standard ouput. > > I'm happy to take patches if you figure out why readline.h is still > being detected without a readline-dev package. It's not detected. The extension is installed with thee dummy_makefile option when no readline is found. It's clear from the extconf file link you posted: https://github.com/cldwalker/bond/blob/master/ext/readline_line_buffer/extconf.rb Then the extension cannot be loaded, obviously. When gem installation succeds rubygems consumes all output so the message you put in extconf.rb is not displayed. With this patch installation fails when readline is not found and the message is shown then, Instead of false you might want to include a check for an extconf argument (such as --without-readline) that forces instaltion of the gem even when readline is not present and is required for the extension to be fully functional. --- ext/readline_line_buffer/extconf.rb.orig 1970-01-01 01:00:00.000000000 +0100 +++ ext/readline_line_buffer/extconf.rb 2011-01-09 12:08:52.000000000 +0100 @@ -11,9 +11,9 @@ dir_config("readline") have_library('readline') if !have_header('readline/readline.h') - puts "Bond was built without readline. To use it with readline: gem install bond" + + puts "Bond requires readline on this version of Ruby. To specify readline location use:\ngem install bond" + " -- --with-readline-dir=/path/to/readline" - dummy_makefile + false else create_makefile 'readline_line_buffer' end > > Did you try gem install bond -- --with-readline-lib=/path/to/your/lib > --with- > readline-include=/path/to/your/include ? > Don't need that. Readline is detected correctly when present. Thanks Michal