Forum: Ruby Ruby 1.8.4 Mac OS X readline problems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Daniel H. (Guest)
on 2005-12-24 20:00
(Received via mailing list)
Is anyone else having this problem?

#++++++
$ make test-all
./miniruby ./runruby.rb --extout=.ext -- -C "./test" runner.rb --
runner=console
dyld: NSLinkModule() error
dyld: Symbol not found: _rl_filename_completion_function
   Referenced from: /Users/dharple/ruby-1.8.4/.ext/powerpc-
darwin8.3.0/readline.bundle
   Expected in: flat namespace

make: *** [test-all] Trace/BPT trap
$
#++++++

My scripts run fine, but now I can't use readline in IRB (or anywhere).

Mac OS X 10.4.3
gcc version 4.0.0 (Apple Computer, Inc. build 5026)

Compiling on Mac OS X 10.3.9 with gcc version 3.3 20030304 (Apple
Computer, Inc. build 1666) I get a borked DRB test that exits with an
error and no subsequent tests are run.

-- Daniel
J. Ryan S. (Guest)
on 2005-12-25 06:55
(Received via mailing list)
On Dec 24, 2005, at 12:58 PM, Daniel H. wrote:

>   Expected in: flat namespace
>
> Compiling on Mac OS X 10.3.9 with gcc version 3.3 20030304 (Apple
> Computer, Inc. build 1666) I get a borked DRB test that exits with
> an error and no subsequent tests are run.
>
> -- Daniel
>

My advice is to wait until the 1.8.4 package is available from Darwin
Ports or Fink.  I highly encourage everyone to use one (or both) of
these tools for managing 99.9% of the *nix software on OS X.

http://darwinports.opendarwin.org/
http://fink.sourceforge.net/

~ ryan ~
Jim M. (Guest)
on 2005-12-25 18:30
(Received via mailing list)
On 12/24/05, J. Ryan S. <removed_email_address@domain.invalid> wrote:
>
> On Dec 24, 2005, at 12:58 PM, Daniel H. wrote:
>
> > Is anyone else having this problem?

Yes, I am. I don't want to install Fink or Darwin ports. I got
readline working with 1.8.2, and am now struggling to get it to work
with 1.8.4. readline.bundle is in ruby/1.8/powerpc-darwin8.3.0.

I used "./configure --with-readline --enable-shared" to configure
Ruby, then make, then make install. When I tried running "rake test"
on a random Rails 1.0 project, the unit tests fail with

/usr/local/bin/ruby -Ilib:test
"/usr/local/lib/ruby/gems/1.8/gems/rake-0.6.2/lib/rake/rake_test_loader.rb"
"test/unit/bookmark_test.rb" "test/unit/group_test.rb"
"test/unit/inbox_test.rb" "test/unit/user_test.rb"
dyld: NSLinkModule() error
dyld: Symbol not found: _rl_filename_completion_function
  Referenced from:
/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/readline.bundle
  Expected in: flat namespace

rake aborted!
Command failed with status (): [/usr/local/bin/ruby -Ilib:test
"/usr/local...]


Jim
--
Jim M., removed_email_address@domain.invalid, 
removed_email_address@domain.invalid
http://www.io.com/~jimm
"Linux is like a wigwam. No windows, no gates and an apache inside."
    -- Unknown
Michal S. (Guest)
on 2005-12-26 13:09
(Received via mailing list)
On 12/25/05, Jim M. <removed_email_address@domain.invalid> wrote:
> I used "./configure --with-readline --enable-shared" to configure
>   Expected in: flat namespace
>
> rake aborted!
> Command failed with status (): [/usr/local/bin/ruby -Ilib:test "/usr/local...]
>
Hello

Your extension was not properly linked when ruby was built. If you did
the ruby tests it would probably reveal that. Since ruby does link
with -undefined suppress it happily builds and installs extensions
that do not work.
You can find the LDFLAGS change among the fink patches for ruby. I do
not know why ruby does this. I tried to post the patch here or to some
bugtracking system but I never noticed any explanation coming my way
nor was the patch applied.

Thanks

Michal


--
             Support the freedom of music!
Maybe it's a weird genre  ..  but weird is *not* illegal.
Maybe next time they will send a special forces commando
to your picnic .. because they think you are weird.
 www.music-versus-guns.org  http://en.policejnistat.cz
Gregory B. (Guest)
on 2005-12-27 01:12
(Received via mailing list)
On 12/26/05, Michal S. <removed_email_address@domain.invalid> wrote:
> Your extension was not properly linked when ruby was built. If you did
> the ruby tests it would probably reveal that. Since ruby does link
> with -undefined suppress it happily builds and installs extensions
> that do not work.
> You can find the LDFLAGS change among the fink patches for ruby. I do
> not know why ruby does this. I tried to post the patch here or to some
> bugtracking system but I never noticed any explanation coming my way
> nor was the patch applied.

Have you offered this patch on the ruby-core mailing list?
Jim M. (Guest)
on 2005-12-27 16:15
(Received via mailing list)
Here's how I fixed this problem: after installing Ruby 1.8.4, I edited
/usr/local/lib/ruby/1.8/powerpc-darwin8.3.0/rbconfig.rb and added
"-lreadline" to the end of CONFIG["LIBS"].

Jim
--
Jim M., removed_email_address@domain.invalid, 
removed_email_address@domain.invalid
http://www.io.com/~jimm
I sit in a chair, pressing small plastic rectangles with my fingers
while
peering at many tiny, colored dots.
Michal S. (Guest)
on 2005-12-27 18:02
(Received via mailing list)
On 12/27/05, Gregory B. <removed_email_address@domain.invalid> wrote:
> Have you offered this patch on the ruby-core mailing list?
>
>

No, I am not subscribed to ruby-core.

Aside my attempts to use ruby on exotic platforms now and then I am
not doing anything to the interpreter :)

Thanks

Michal


--
             Support the freedom of music!
Maybe it's a weird genre  ..  but weird is *not* illegal.
Maybe next time they will send a special forces commando
to your picnic .. because they think you are weird.
 www.music-versus-guns.org  http://en.policejnistat.cz
Paul S. (Guest)
on 2005-12-27 21:24
(Received via mailing list)
On 12/24/05, Daniel H. <removed_email_address@domain.invalid> wrote:
>    Expected in: flat namespace
>
> make: *** [test-all] Trace/BPT trap

I had this same problem. I rebuilt my readline library ala:

  wget ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz
  tar -xzf readline-5.1.tar.gz
  cd readline-5.1
  ./configure --prefix=/usr/local && make && sudo make install

And then rebuilt ruby:

  make distclean && configure --with-readline-dir=/usr/local && make
&& make test-all

And all was well.

-Paul

--
Paul S.
mobile: (773) 934-4607
aim/yim: thaislump
gtalk: removed_email_address@domain.invalid
Center for Neighborhood Technology
Technology Director, Wireless Community Networks
Chicago IL, USA
Peter B. (Guest)
on 2006-01-25 09:03
>>    Expected in: flat namespace
>>
>> make: *** [test-all] Trace/BPT trap
>
>
> make distclean && configure --with-readline-dir=/usr/local && make && make test-all
>
>
> And all was well.
>
> -Paul
>
> --
> Paul S.
> mobile: (773) 934-4607
> aim/yim: thaislump
> gtalk: removed_email_address@domain.invalid
> Center for Neighborhood Technology
> Technology Director, Wireless Community Networks
> Chicago IL, USA

This also solved the problem for me.  Thanks for posting this Paul (:

I had to use curl though, as wget wasn't installed:

curl -O ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz
tar -xzf readline-5.1.tar.gz
cd readline-5.1
./configure --prefix=/usr/local && make && sudo make install
jimmyether (Guest)
on 2006-04-07 16:28
Paul S. wrote:
>   wget ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz
>   tar -xzf readline-5.1.tar.gz
>   cd readline-5.1
>   ./configure --prefix=/usr/local && make && sudo make install
>
> And then rebuilt ruby:
>
>   make distclean && configure --with-readline-dir=/usr/local && make
> && make test-all
>
> And all was well.

I did this (though I couldn't get make distclean to run). And the test
still show an issue with WEBrick:

 1) Failure:
test_cgi(TestWEBrickCGI)
    [./webrick/test_cgi.rb:27:in `test_cgi'
     /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:1049:in `request'
     /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:2104:in
`reading_body'
     /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:1048:in `request'
     /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:1033:in `request'
     /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:545:in `start'
     /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:1031:in `request'
     ./webrick/test_cgi.rb:27:in `test_cgi'
     ./webrick/utils.rb:26:in `start_server'
     ./webrick/utils.rb:34:in `start_httpserver'
     ./webrick/test_cgi.rb:24:in `test_cgi']:
<"/webrick.cgi"> expected but was
<"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n<HTML>\n
<HEAD><TITLE>Internal Server Error</TITLE></HEAD>\n  <BODY>\n
<H1>Internal Server Error</H1>\n    Premature end of script headers:
/Users/jimmyether/src/ruby-1.8.4/test/webrick/webrick.cgi\n    <HR>\n
<ADDRESS>\n     WEBrick/1.3.1 (Ruby/1.8.4/2005-12-24) OpenSSL/0.9.7i
at\n     127.0.0.1:49746\n    </ADDRESS>\n  </BODY>\n</HTML>\n">.

1313 tests, 14444 assertions, 1 failures, 0 errors
make: *** [test-all] Error 1



Any suggestions on how to fix this?
Maggie R. (Guest)
on 2007-07-15 06:01
I am having this problem with Ruby 1.8.6 and OSX 10.4.10.

I followed the fix instructions using curl:
curl -O ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz
tar -xzf readline-5.1.tar.gz
cd readline-5.1
./configure --prefix=/usr/local && make && sudo make install


Can you explain how to rebuild Ruby with make distclean && configure
--with-readline-dir=/usr/local && make && make test-all?

I tried pasting in the line after the ./configure was done, but I had no
success with the fix.
Did you resolve this problem??




jimmyether wrote:
> Paul S. wrote:
>>   wget ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz
>>   tar -xzf readline-5.1.tar.gz
>>   cd readline-5.1
>>   ./configure --prefix=/usr/local && make && sudo make install
>>
>> And then rebuilt ruby:
>>
>>   make distclean && configure --with-readline-dir=/usr/local && make
>> && make test-all
>>
>> And all was well.
>
> I did this (though I couldn't get make distclean to run). And the test
> still show an issue with WEBrick:
>
>  1) Failure:
> test_cgi(TestWEBrickCGI)
>     [./webrick/test_cgi.rb:27:in `test_cgi'
>      /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:1049:in `request'
>      /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:2104:in
> `reading_body'
>      /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:1048:in `request'
>      /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:1033:in `request'
>      /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:545:in `start'
>      /Users/jimmyether/src/ruby-1.8.4/lib/net/http.rb:1031:in `request'
>      ./webrick/test_cgi.rb:27:in `test_cgi'
>      ./webrick/utils.rb:26:in `start_server'
>      ./webrick/utils.rb:34:in `start_httpserver'
>      ./webrick/test_cgi.rb:24:in `test_cgi']:
> <"/webrick.cgi"> expected but was
> <"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n<HTML>\n
> <HEAD><TITLE>Internal Server Error</TITLE></HEAD>\n  <BODY>\n
> <H1>Internal Server Error</H1>\n    Premature end of script headers:
> /Users/jimmyether/src/ruby-1.8.4/test/webrick/webrick.cgi\n    <HR>\n
> <ADDRESS>\n     WEBrick/1.3.1 (Ruby/1.8.4/2005-12-24) OpenSSL/0.9.7i
> at\n     127.0.0.1:49746\n    </ADDRESS>\n  </BODY>\n</HTML>\n">.
>
> 1313 tests, 14444 assertions, 1 failures, 0 errors
> make: *** [test-all] Error 1
>
>
>
> Any suggestions on how to fix this?
This topic is locked and can not be replied to.