Fixing Symbol not found _rl_filename_completion_function

Not a full article this time but rather a tip that will help poor souls looking for their salvation on Google.

By the way I think I will divide this blog in two sections: articles on one side, hints and tips on the other. I’d love to hear your opinion on that – two separate feeds or just two tabs ?

Full credit goes to Matthew Hutchinson who wrote this comment. I believe the article will make it easier for people to find the solution.

Some context: I’m working on a Merb + CouchDb application I will introduce to you in the next few weeks. While installing a dependency with Thor, I got the following error:


bash-3.2$ thor merb:gem:install dm-more
dyld: NSLinkModule() error
dyld: Symbol not found: _rl_filename_completion_function
  Referenced from: /usr/local/lib/ruby/1.8/i686-darwin9.5.0/readline.bundle
  Expected in: flat namespace

Trace/BPT trap
bash-3.2$

I had recompiled a version of Ruby (switching from 1.8.6 patchlevel 0 to patchlevel 111) and got this error a few days later.

“rl” and “readline” give us clues about what’s happening – I googled and found Matthew’s tip. I went back to where I had downloaded the Ruby source and did:


cd /usr/local/src/ruby-1.8.6-p111/ext/readline
ruby extconf.rb
make clean # possibly needed
make
sudo make install

And this reinstalled the readline bundle:


/usr/bin/install -c -m 0755 readline.bundle /usr/local/lib/ruby/site_ruby/1.8/i686-darwin9.5.0

Then back to thor, everything was back to normal:


bash-3.2$ thor merb:gem:install dm-more
Installing dm-more...
Successfully installed dm-couchdb-adapter-0.9.6
Successfully installed dm-rest-adapter-0.9.6
... snip ...

Hope this will be useful to some of you!

The comments system is brand new - don't be afraid to comment!