mod_ruby+eruby module inclusion confusion

Discussion in 'Ruby' started by Mark J. Reed, Feb 18, 2005.

  1. Mark J. Reed

    Mark J. Reed Guest

    I upgraded to ruby 1.8.2, eruby 1.0.5, and mod_ruby 1.2.4 without otherwise
    changing my existing Apache 2.0.48 installation, and a bunch of pages broke.

    It turns out that the following is what's not working. Given a file
    'my_module.rb' which defines module MyModule which has a method called
    my_method, this used to work:

    <% require 'my_module' %>
    <% include MyModule %>

    ... bunch of HTML ...

    <%= my_method; %>

    And it still does when I run eruby from the command line. But when the
    same rhtml file is run via mod_ruby, the include doesn't seem to work; it's
    like it's getting run in a subscope or something and not affecting the
    same main object used by the rest of the script. I have to change
    the my_method; call to be explicitly MyModule::my_method;.

    Any ideas why this would be the case?
     
    Mark J. Reed, Feb 18, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. paul vudmaska
    Replies:
    4
    Views:
    144
    paul vudmaska
    Sep 1, 2003
  2. Daniel Cremer

    my mod_ruby doesn't like my eruby

    Daniel Cremer, Sep 14, 2003, in forum: Ruby
    Replies:
    0
    Views:
    127
    Daniel Cremer
    Sep 14, 2003
  3. Useko Netsumi

    eruby & mod_ruby under windows

    Useko Netsumi, Sep 15, 2003, in forum: Ruby
    Replies:
    0
    Views:
    99
    Useko Netsumi
    Sep 15, 2003
  4. Useko Netsumi

    latest mod_ruby and eruby ..

    Useko Netsumi, Oct 16, 2003, in forum: Ruby
    Replies:
    0
    Views:
    119
    Useko Netsumi
    Oct 16, 2003
  5. Robert McKinnon
    Replies:
    1
    Views:
    212
    Dave Thomas
    Mar 6, 2004
Loading...

Share This Page