Re: Problem with classes

Brian Candler <[email protected]> Tue, 9 Aug 2005 20:41:39 +0100
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
On Tue, Aug 09, 2005 at 09:15:36PM +0200, Andi Scharfstein wrote:
> Well, "Entry" is defined in the same file as the code using it, and in
> fact it works flawlessly when invoked from the command line - it's
> just when I'm using Apache that I get this error. Does anybody know
> what might be the cause of this curious behaviour? Thanks for any
> input on this.

My guess (not yet a mod_ruby user but just lurking :-)

I seem to remember that mod_ruby loads code into an anonymous module, e.g.
imagine that your code is wrapped in

    module XYZ123456
      ... your code
    end

In that case, your definition of class Entry is actually XYZ123456::Entry.
Try changing the definition to

class ::Entry

and see if that makes a difference.

HTH,

Brian.