Readline not working with Ruby

Stewart wrote:

/usr/local/src/ruby-1.8.7-p72/ext/readline $ make
make: Nothing to be done for all'. /usr/local/src/ruby-1.8.7-p72/ext/readline $ make install make: Nothing to be done forinstall’.
/usr/local/src/ruby-1.8.7-p72/ext/readline $ ls
Makefile README README.ja depend extconf.rb readline.bundle
readline.c readline.o
/usr/local/src/ruby-1.8.7-p72/ext/readline $

Did not do anything Does not seem anything was made.

Just to be sure, you might want to try (in the same dir):

make distclean (should delete the makefile)
ruby extconf.rb (should regenerate the makefile, and find the readline
libs)
make
make install

Stewart wrote:

/usr/local/src/ruby-1.8.7-p72/ext/readline $ make
make: Nothing to be done for all'. /usr/local/src/ruby-1.8.7-p72/ext/readline $ make install make: Nothing to be done for install’.
/usr/local/src/ruby-1.8.7-p72/ext/readline $ ls
Makefile README README.ja depend extconf.rb readline.bundle
readline.c readline.o
/usr/local/src/ruby-1.8.7-p72/ext/readline $

Did not do anything Does not seem anything was made.

Hmm, maybe 1.8.7 works differently to 1.8.6 in this regards.

Clearly something was built, because you have the object file
(readline.o) and what is presumably the shared library object (I’m
guessing that’s what readline.bundle is - it would be readline.so on a
more normal Unix flavour)

$ ruby -rreadline -e ‘p 42’
/usr/local/ruby_test/lib/ruby/site_ruby/1.8/i686-darwin9.6.0/readline.bundle: dlopen(/usr/local/ruby_test/lib/ruby/site_ruby/1.8/i686-darwin9.6.0/readline.bundle, 9): Symbol not found: _rl_filename_completion_function (LoadError)
Referenced from: /usr/local/ruby_test/lib/ruby/site_ruby/1.8/i686-darwin9.6.0/readline.bundle

OK, now you’re getting to the bottom of it. Clearly the module was
built, but there’s a runtime error when it loads, because it has linked
to a function which doesn’t exist. irb doesn’t show you the error
because it rescues any exceptions arising from loading the readline
library, and continues without it.

Possibly Mac’s libedit isn’t sufficiently compatible with libreadline,
or vice versa, but I’m afraid you’ll need a Mac expert to help you.
However googling for “compile ruby mac OSX” turns up what appears to be
some useful instructions, such as

HTH,

Brian.

Stewart wrote:

makes me wonder how ruby was compiled with readline in the first palce.

C is a tolerant language, from its K&R heritage. Calling a function
which has not been declared will only give a warning, not an error
(although gcc has a flag to turn this into an error)

That warning only becomes a hard error at link time, if the linker tries
to find the named function and fails.

On Aug 11, 7:42 pm, Brian C. [email protected] wrote:

Did not do anything Does not seem anything was made.
Referenced from: /usr/local/ruby_test/lib/ruby/site_ruby/1.8/i686-darwin9.6.0/readline.bundle
some useful instructions, such ashttp://hivelogic.com/articles/ruby_rails_lighttpd_mysql_tiger

HTH,

Brian.

Posted viahttp://www.ruby-forum.com/.

Oddly enough its an updated version of that article I used in the
first place. Turns out there is a patch to readline. Then you can
use --with-readline-dir=/usr/local but if the patch is not applied
then readline wont work on a mac. Here is the blog post with details
of how to apply the pacth.

http://blog.bogojoker.com/2008/06/installing-ruby-187-on-mac-os-x-1053/

makes me wonder how ruby was compiled with readline in the first palce.