M
Mark J. Reed
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?
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?