From: Stewart Date: 2009-08-12T20:15:10+09:00 Subject: Re: Readline not working with Ruby On Aug 11, 7:42 pm, Brian Candler wrote: > 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 whatreadline.bundle is - it would bereadline.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 thereadline > 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 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.