# Ruby 1.8.5 and Readline on Mac OS X 10.4.8 (Intel)

**URL:** <https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956>\
**Category:** Rails\
**Created:** [October 4, 2006, 7:40am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956 "2006-10-04T07:40:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [October 4, 2006, 7:40am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/1 "2006-10-04T07:40:31Z")

</div>

I’ve followed the hivelogic instructions  
([Dan Benjamin](http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger)),  
using the latest release versions of software where possible. That  
included Ruby 1.8.5 and PCRE 6.7 (and I think that’s it).

I’ve now run into a problem I’ve seen discussed elsewhere - faulty  
readline support. Most of the solutions seem to point to this URL for an  
answer:  
[http://www.nabble.com/Ruby-1.8.4-Mac-OS-X-readline-problems-t801880.html](http://www.nabble.com/Ruby-1.8.4-Mac-OS-X-readline-problems-t801880.html)  
.

I’m working my way through the Agile Web D. and attempting to  
run my server (localhost:3000). I’ve run the “make test-all” suggested  
in the URL above, but I’m still unable to get anything to run without  
the seemingly common error:

“dyld: NSLinkModule() error  
dyld: Symbol not found: \_rl\_filename\_completion\_function  
Referenced from:  
/usr/local/lib/ruby/1.8/i686-darwin8.8.1/readline.bundle  
Expected in: flat namespace”

One difference may be that I’m on a Mac Pro (thus an Intel machine).

Can anyone help? If I’m asking in the wrong place, please point me in  
the right direction. Thank you for any help you can provide.

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [October 4, 2006, 7:52am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/2 "2006-10-04T07:52:19Z")

</div>

FWIW, I’d rather not use fink or darwinports. I read about the issues  
with readline in 1.8.4. That - and the fact that such a problem seemed  
to be so widely understood - is what led me to go with the updated  
1.8.5.

I’m running make test-all currently. It’s been running for nearly 40  
minutes. I have a bunch of, well:

% make test-all  
./miniruby ./runruby.rb --extout=.ext – -C “./test” runner.rb  
–runner=console  
Loaded suite .  
Started  
…E.E.E.E…

(Periods are appearing once every few minutes after an initial burst of  
many periods.)

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [October 4, 2006, 1:02pm UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/3 "2006-10-04T13:02:18Z")

</div>

The readline “problem” on OS X has nothing to do with ruby  
1.8.4/1.8.5/whatever. The issue is that there is a partial “readline”  
library in /usr/lib (libedit or something…) and that is what your  
build is linking to by default (as /usr/lib comes before /usr/local/lib  
in the link path). Rrebuilding using the  
–with-readline-dir=/usr/local configuration option should fix it  
(assuming you have installed the true readline in /usr/local).

-r

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [October 4, 2006, 5:54pm UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/4 "2006-10-04T17:54:17Z")

</div>

I’m fairly confident I’ve solved the problem:

Someone posted here:  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129980](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129980) and  
asked someone else if

ruby -rreadline -e ‘1’

gave an error. It did to me, so they said to go into ext/readline in the  
ruby source directory and type

ruby extconf.rb

and then the `make / sudo make install` routine. It worked!  
My local:3000 server doesn’t crash and ruby on the command line works.

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [October 4, 2006, 3:21pm UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/5 "2006-10-04T15:21:15Z")

</div>

removed\_email\_address@domain.invalid wrote:

> The readline “problem” on OS X has nothing to do with ruby  
> 1.8.4/1.8.5/whatever. The issue is that there is a partial “readline”  
> library in /usr/lib (libedit or something…) and that is what your  
> build is linking to by default (as /usr/lib comes before /usr/local/lib  
> in the link path). Rrebuilding using the  
> –with-readline-dir=/usr/local configuration option should fix it  
> (assuming you have installed the true readline in /usr/local).

I don’t believe that to be the case.

First, “/usr/local/bin:/usr/local/sbin” are the first two items in my  
$PATH. The Hivelogic procedure makes sure you set your path (about 100  
times), so I took care to.

Second, following the hivelogic post above, my ruby configure line  
looked like:  
/configure --prefix=/usr/local --enable-pthread  
–with-readline-dir=/usr/local

I’ve tried both readline 5.1 and 5.0 with no success. I ran “make  
test-all” and the results are at  
[http://nslog.com/archives/2006/10/04/building\_ruby\_rails\_lighttpd\_and\_mysql\_on\_tiger.php#comments](http://nslog.com/archives/2006/10/04/building_ruby_rails_lighttpd_and_mysql_on_tiger.php#comments)  
.

Thank you for attempting to help. Are there any other suggestions or  
ideas? I’d really like to begin learning.

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [January 29, 2007, 4:07am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/6 "2007-01-29T04:07:05Z")

</div>

Erik J. Barzeski wrote:

> I’ve followed the hivelogic instructions  
> ([Dan Benjamin](http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger)),  
> using the latest release versions of software where possible. That  
> included Ruby 1.8.5 and PCRE 6.7 (and I think that’s it).
> 
> I’ve now run into a problem I’ve seen discussed elsewhere - faulty  
> readline support. Most of the solutions seem to point to this URL for an  
> answer:  
> [http://www.nabble.com/Ruby-1.8.4-Mac-OS-X-readline-problems-t801880.html](http://www.nabble.com/Ruby-1.8.4-Mac-OS-X-readline-problems-t801880.html)  
> .
> 
> I’m working my way through the Agile Web D. and attempting to  
> run my server (localhost:3000). I’ve run the “make test-all” suggested  
> in the URL above, but I’m still unable to get anything to run without  
> the seemingly common error:
> 
> “dyld: NSLinkModule() error  
> dyld: Symbol not found: \_rl\_filename\_completion\_function  
> Referenced from:  
> /usr/local/lib/ruby/1.8/i686-darwin8.8.1/readline.bundle  
> Expected in: flat namespace”
> 
> One difference may be that I’m on a Mac Pro (thus an Intel machine).
> 
> Can anyone help? If I’m asking in the wrong place, please point me in  
> the right direction. Thank you for any help you can provide.

I just followed the steps from  
[http://www.nabble.com/Ruby-1.8.4-Mac-OS-X-readline-problems-t801880.html](http://www.nabble.com/Ruby-1.8.4-Mac-OS-X-readline-problems-t801880.html)  
and it works. I think I built readline and ruby in that way at the very  
begin. But surprisingly rebuilding readline and ruby did work! I am  
running a mac book with intel duo core.

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [February 14, 2007, 4:12am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/7 "2007-02-14T04:12:11Z")

</div>

Erik J. Barzeski wrote:

> I’m fairly confident I’ve solved the problem:
> 
> Someone posted here:  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129980](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129980) and  
> asked someone else if
> 
> ruby -rreadline -e ‘1’
> 
> gave an error. It did to me, so they said to go into ext/readline in the  
> ruby source directory and type
> 
> ruby extconf.rb
> 
> and then the `make / sudo make install` routine. It worked!  
> My local:3000 server doesn’t crash and ruby on the command line works.

Thank you so much for posting this solution:

After trying numerous suggestions, this was the winner.

Just as an addition, it might be a good idea to do this in the  
following sequence from the (ruby source directory)/ext/readline,  
especially if you’ve been toiling away for a bit:

#make clean  
#sudo ruby extconf.rb  
#make  
#sudo make install

Regards

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [February 14, 2007, 4:42am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/8 "2007-02-14T04:42:33Z")

</div>

hey buddy, those instructions are two years old

try these new ones from hive this year

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

worked great for me

good luck

On 10/4/06, Erik J. Barzeski [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> answer:  
> Referenced from:
> 
> >

–  
[www.blogsaic.com](http://www.blogsaic.com)  
view, visit, vote

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [April 3, 2007, 4:35pm UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/9 "2007-04-03T16:35:52Z")

</div>

I was having exactly the same issue, Brand new OSX install on a G5,  
10.4.9 with all updates applied. I followed the NEW Hive install guide  
to the letter and ended up with this very same error we are all talking  
about. I followed the /ext/readline ./ruby extconf.rb directions and it  
now all works fine. Very strange ! Locomotive was such a sugar treat !

Dion H. wrote:

> hey buddy, those instructions are two years old
> 
> try these new ones from hive this year
> 
> [http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx](http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx)
> 
> worked great for me
> 
> good luck
> 
> On 10/4/06, Erik J. Barzeski [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > answer:  
> > Referenced from:
> > 
> > >
> 
> –  
> [www.blogsaic.com](http://www.blogsaic.com)  
> view, visit, vote

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [April 29, 2007, 2:27am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/10 "2007-04-29T02:27:48Z")

</div>

Joseph wrote:

> Erik J. Barzeski wrote:
> 
> > I’m fairly confident I’ve solved the problem:
> > 
> > Someone posted here:  
> > [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129980](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129980) and  
> > asked someone else if
> > 
> > ruby -rreadline -e ‘1’
> > 
> > gave an error. It did to me, so they said to go into ext/readline in the  
> > ruby source directory and type
> > 
> > ruby extconf.rb
> > 
> > and then the `make / sudo make install` routine. It worked!  
> > My local:3000 server doesn’t crash and ruby on the command line works.
> 
> Brilliant, thank you.

Ive followed the hivelogic article to a T everything I thought was  
working until I ran into this error that you are all speaking of. I even  
go into irb and it give ths error  
dyld: NSLinkModule() error  
dyld: Symbol not found: \_rl\_filename\_completion\_function  
Referenced from:  
/usr/local/lib/ruby/site\_ruby/1.8/i686-darwin8.9.1/readline.bundle  
Expected in: flat namespace

Trace/BPT trap

Ive followed the ext/readline instructions  
stiill nothing… anyone have any suggestions?

-Mick

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [April 7, 2007, 1:20am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/11 "2007-04-07T01:20:01Z")

</div>

Erik J. Barzeski wrote:

> I’m fairly confident I’ve solved the problem:
> 
> Someone posted here:  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129980](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/129980) and  
> asked someone else if
> 
> ruby -rreadline -e ‘1’
> 
> gave an error. It did to me, so they said to go into ext/readline in the  
> ruby source directory and type
> 
> ruby extconf.rb
> 
> and then the `make / sudo make install` routine. It worked!  
> My local:3000 server doesn’t crash and ruby on the command line works.

Brilliant, thank you.

---

<div class="post-metadata">

**Author:** ![Erik\_JSBarzeski](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/a5b964/32.png) [@Erik\_JSBarzeski](https://www.ruby-forum.com/u/Erik_JSBarzeski)\
**Post date:** [April 29, 2007, 4:08am UTC](https://www.ruby-forum.com/t/ruby-1-8-5-and-readline-on-mac-os-x-10-4-8-intel/70956/12 "2007-04-29T04:08:09Z")

</div>

On 4/28/07, Mick R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [Â…]
> 
> Ive followed the ext/readline instructions  
> stiill nothing… anyone have any suggestions?

i have always used james duncan davidson’s Sandboxing Rails With  
MacPortswithout issue:  
[http://blog.duncandavidson.com/2006/04/sandboxing\_rail.html](http://blog.duncandavidson.com/2006/04/sandboxing_rail.html)

he also provides some color on install source vs. macports.

cheers,  
jean-pierre
