eRuby on Mac OS X


(Jim Menard) #1

I’ve searched ruby-talk for this topic, and the only messages I found show
the same symptoms I’m seeing: mod_ruby and eRuby compile fine, mod_ruby
runs (within Apache), but eRuby doesn’t. eRuby runs fine on the command
line, though.

I have a few more clues that may let someone figure out what may be wrong.
When the line

RubyRequire apache/eruby-run

is executed from httpd.conf, these error messages are written to the file
/var/log/httpd/error_log:

dyld: /usr/sbin/httpd Undefined symbols:
_rb_cObject
_rb_check_type
_rb_data_object_alloc
_rb_define_class_under
_rb_define_method
_rb_define_module
_rb_define_singleton_method
_rb_define_virtual_variable
_rb_eStandardError
_rb_eval_string_wrap
_rb_file_open
_rb_funcall
_rb_gc_mark
_rb_global_variable
_rb_intern
_rb_io_close
_rb_io_gets
_rb_protect
_rb_provide
_rb_raise
_rb_set_kcode
_rb_stdin
_rb_str2cstr
_rb_str_cat
_rb_str_freeze
_rb_str_new
_rb_str_new2
_ruby_debug
_ruby_show_version
_ruby_top_self
_ruby_verbose
_ruby_xmalloc

I’m mystified because mod_ruby seems to be running just fine. Those look
like libruby.a symbols, and if mod_ruby can see it why can’t eRuby?

Jim

···


Jim Menard, jimm@io.com, http://www.io.com/~jimm/
“Hey, wait a minute. You’ve got both eyes! You’re no special agent.
You’re just some jerk who hates my moustache!” - The Tick


(Sean Chittenden) #2

[moving to modruby list]

I’ve searched ruby-talk for this topic, and the only messages I
found show the same symptoms I’m seeing: mod_ruby and eRuby compile
fine, mod_ruby runs (within Apache), but eRuby doesn’t. eRuby runs
fine on the command line, though.

I have a few more clues that may let someone figure out what may be
wrong. When the line

RubyRequire apache/eruby-run

is executed from httpd.conf, these error messages are written to the
file /var/log/httpd/error_log:

Interesting… what version of mod_ruby/eRuby are you using? It
looks as though eRuby isn’t linking against ruby.so or libruby.(so|a).
I don’t have a copy of OS X around, but I think Shugo does. This
sound plausible? -sc

···
dyld: /usr/sbin/httpd Undefined symbols:
_rb_cObject
_rb_check_type
_rb_data_object_alloc
_rb_define_class_under
_rb_define_method
_rb_define_module
_rb_define_singleton_method
_rb_define_virtual_variable
_rb_eStandardError
_rb_eval_string_wrap
_rb_file_open
_rb_funcall
_rb_gc_mark
_rb_global_variable
_rb_intern
_rb_io_close
_rb_io_gets
_rb_protect
_rb_provide
_rb_raise
_rb_set_kcode
_rb_stdin
_rb_str2cstr
_rb_str_cat
_rb_str_freeze
_rb_str_new
_rb_str_new2
_ruby_debug
_ruby_show_version
_ruby_top_self
_ruby_verbose
_ruby_xmalloc


Sean Chittenden


(Chris Gehlker) #3

If it’s supposed to link dynamically, it needs to be against libruby.dylib.
I hope that helps because I don’t have time to pursue it right now.

Why Darwin wants to call things ‘dylib’ when every other *nix calls them
’so’s is a mystery to me. The snipped error message is coming from the
dynamic linker, dyld, though, and that’s what it wants.

···

On 6/18/02 11:03 PM, “Sean Chittenden” sean@ruby-lang.org wrote:

[moving to modruby list]

I’ve searched ruby-talk for this topic, and the only messages I
found show the same symptoms I’m seeing: mod_ruby and eRuby compile
fine, mod_ruby runs (within Apache), but eRuby doesn’t. eRuby runs
fine on the command line, though.

I have a few more clues that may let someone figure out what may be
wrong. When the line

RubyRequire apache/eruby-run

is executed from httpd.conf, these error messages are written to the
file /var/log/httpd/error_log:

Interesting… what version of mod_ruby/eRuby are you using? It
looks as though eRuby isn’t linking against ruby.so or libruby.(so|a).
I don’t have a copy of OS X around, but I think Shugo does. This
sound plausible? -sc


I have suffered from being misunderstood, but I would have suffered a hell
of a lot more if I had been understood. -Clarence Darrow, lawyer and author
(1857-1938)


(Jim Menard) #4

Sean Chittenden sean@ruby-lang.org writes:

Interesting… what version of mod_ruby/eRuby are you using? It
looks as though eRuby isn’t linking against ruby.so or libruby.(so|a).
I don’t have a copy of OS X around, but I think Shugo does. This
sound plausible? -sc

My mod_ruby is v0.9.6, and eruby is 0.9.7.

Jim

···


Jim Menard, jimm@io.com, http://www.io.com/~jimm/
“You will notice that BeOS has taken the best parts from all the major
operating systems and made them its own. We’ve got the power of the Unix
command line, the ease of use of the Macintosh interface, and Minesweeper
from Windows.” – Tyler Riti


(Sean Chittenden) #5

Interesting… what version of mod_ruby/eRuby are you using? It
looks as though eRuby isn’t linking against ruby.so or libruby.(so|a).
I don’t have a copy of OS X around, but I think Shugo does. This
sound plausible? -sc

My mod_ruby is v0.9.6, and eruby is 0.9.7.

Please upgrade to mod_ruby 0.9.9 and the appropriate eRuby version:
there have been several OS X fixes, iirc. -sc

···


Sean Chittenden


(Jean-Hugues ROBERT) #6

Hello,

What is the rational for failure of “” << nil and of “” << :Foo ?

Apparently <<() (and +()) uses to_str() only, never to_s().

However this works: “#{nil}#{:Foo}”

I may do this to define to_str():
class NilClass
def to_str() to_s() end
end
class Symbol
def to_str() to_s() end
end
and then ("" << nil << :Foo) works.

… But I wonder if that could break things in some other cases?

Thanks,

Jean-Hugues

···

Web: http://hdl.handle.net/1030.37/1.1
Phone: +33 (0) 4 92 27 74 17


(Jim Menard) #7

Sean Chittenden sean@chittenden.org writes:

Interesting… what version of mod_ruby/eRuby are you using? It
looks as though eRuby isn’t linking against ruby.so or libruby.(so|a).
I don’t have a copy of OS X around, but I think Shugo does. This
sound plausible? -sc

My mod_ruby is v0.9.6, and eruby is 0.9.7.

Please upgrade to mod_ruby 0.9.9 and the appropriate eRuby version:
there have been several OS X fixes, iirc. -sc

That’s great news. I’ll do so.

Jim

···


Jim Menard, jimm@io.com, http://www.io.com/~jimm/
“If you mark half [of this newsgroup’s] posts as read, you still get
basically all the same information, just with a bit less detail. [This] is
a holographic newsgroup.” – Tom “Tom” Harrington in rec.humor.oracle.d


(Jim Menard) #8

Sean Chittenden sean@chittenden.org writes:

Interesting… what version of mod_ruby/eRuby are you using? It
looks as though eRuby isn’t linking against ruby.so or libruby.(so|a).
I don’t have a copy of OS X around, but I think Shugo does. This
sound plausible? -sc

My mod_ruby is v0.9.6, and eruby is 0.9.7.

Please upgrade to mod_ruby 0.9.9 and the appropriate eRuby version:
there have been several OS X fixes, iirc. -sc

I tried that. Nothing changed: when I uncomment the lines

# # for Apache::ERubyRun
# RubyRequire apache/eruby-run

in httpd.conf, I see the same error messages spewed to the httpd error log
file.

dyld: /usr/sbin/httpd Undefined symbols:
_rb_cObject
_rb_check_type
_rb_data_object_alloc
_rb_define_class_under
.
.
.

Jim

···


Jim Menard, jimm@io.com, http://www.io.com/~jimm/
“The Be staff…went to see the movie ‘Men in Black.’ …The movie makes
a point that is somehow appropriate – It is impossible to completely rid
the universe of bugs, but at least you can drive something fast, arm
yourself with powerful tools, and look good doing it.” – markg@be.com


(David Alan Black) #9

Hello –

···

On Thu, 20 Jun 2002, Jean-Hugues ROBERT wrote:

Hello,

What is the rational for failure of “” << nil and of “” << :Foo ?

Apparently <<() (and +()) uses to_str() only, never to_s().

However this works: “#{nil}#{:Foo}”

I may do this to define to_str():
class NilClass
def to_str() to_s() end
end
class Symbol
def to_str() to_s() end
end
and then ("" << nil << :Foo) works.

… But I wonder if that could break things in some other cases?

See whether http://www.ruby-talk.org/blade/11223, which was my shot
last year at explaining the #to_str/#to_s relation (both what and
why), is helpful. (It isn’t the last word in this area, but it’s
pretty much what I’d still say, so I’ll refer to it rather than quote
it at length :slight_smile:

David


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav


(Sean Chittenden) #10

[moving to modruby@modruby.net]

> > > Interesting... what version of mod_ruby/eRuby are you using?
> > > It looks as though eRuby isn't linking against ruby.so or
> > > libruby.(so|a). I don't have a copy of OS X around, but I
> > > think Shugo does. This sound plausible? -sc
> >
> > My mod_ruby is v0.9.6, and eruby is 0.9.7.
>
> Please upgrade to mod_ruby 0.9.9 and the appropriate eRuby
> version: there have been several OS X fixes, iirc. -sc

I tried that. Nothing changed: when I uncomment the lines

    # # for Apache::ERubyRun
    # RubyRequire apache/eruby-run

in httpd.conf, I see the same error messages spewed to the httpd
error log file.

    dyld: /usr/sbin/httpd Undefined symbols:
    _rb_cObject
    _rb_check_type
    _rb_data_object_alloc
    _rb_define_class_under
    .
    .
    .

Hmm... it looks like your httpd binary can't find any of the core ruby
symbols. Why that's happening I have no clue. Did you statically
compile in Ruby? -sc

···

--
Sean Chittenden


(James) #11

See whether http://www.ruby-talk.org/blade/11223, which was my shot
last year at explaining the #to_str/#to_s relation (both what and
why), is helpful. (It isn’t the last word in this area, but it’s
pretty much what I’d still say, so I’ll refer to it rather than quote
it at length :slight_smile:

That page comes up in Japanese.

This comes up in English:
http://www.ruby-talk.com/blade/11233

.com = English?
.org = Japanese?

James

···

David


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav


(Jim Menard) #12

Sean Chittenden sean@ruby-lang.org writes:

Hmm… it looks like your httpd binary can’t find any of the core ruby
symbols. Why that’s happening I have no clue. Did you statically
compile in Ruby? -sc

As I wrote to you, I didn’t compile Apache, and I used the defaults for
eRuby.

Jim

···


Jim Menard, jimm@io.com, http://www.io.com/~jimm/
“Eating kittens is just plain … plain wrong! And no one should do it, ever!”
– The Tick


(David Alan Black) #13

Hi –

···

On Sat, 22 Jun 2002 james@rubyxml.com wrote:

See whether http://www.ruby-talk.org/blade/11223, which was my shot
last year at explaining the #to_str/#to_s relation (both what and
why), is helpful. (It isn’t the last word in this area, but it’s
pretty much what I’d still say, so I’ll refer to it rather than quote
it at length :slight_smile:

That page comes up in Japanese.

This comes up in English:
http://www.ruby-talk.com/blade/11233

.com = English?
.org = Japanese?

Weird: for me, they both come up in English in Netscape but in
Japanese in lynx. I can’t quite puzzle through why, but thanks for
flagging the problem.

David


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav