Getting eRuby to run under mod_ruby

Hi,

I have mod_ruby running fine for regular Ruby scripts, but attempting to
call eRuby from mod_ruby yields this error:

[Mon Jan 27 10:23:59 2003] [error] mod_ruby: error in ruby
(eval): uninitialized constant ERubyRun at Apache (NameError)
from ruby:0:in `value’

I found a couple of messages in the archives from people with the same
problem, but no solution other than a pasted config from someone for
whom it worked.

My config seems to conform to the instructions:

RubyRequire apache/ruby-run Alias /mod_ruby /var/www/ruby
# Execcute files under /ruby as Ruby scripts
<Location /mod_ruby>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
    Options +ExecCGI
</Location> 

# Execute *.rbx files as Ruby scripts
<Files *.rbx>
    SetHandler ruby-object
    RubyHandler Apache::RubyRun.instance
</Files>

handle *.rhtml as eruby files.

<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance

From the error, it would appear that eRuby is being invoked. It’s just
that something isn’t being initialised correctly.

This is with Ruby 1.6.8, eRuby 1.0.2 and mod_ruby 1.0.4.

Any ideas? As usual, I feel like I must be missing something obvious.

Ian

···


Ian Macdonald | The best portion of a good man’s life, his
ian@caliban.org | little, nameless, unremembered acts of
> kindness and love. – Wordsworth
>
>

It turned out I was missing the following line:

RubyRequire apache/eruby-run

Ian

···

On Tue 28 Jan 2003 at 06:14:04 +0900, Ian Macdonald wrote:

I have mod_ruby running fine for regular Ruby scripts, but attempting to
call eRuby from mod_ruby yields this error:

[Mon Jan 27 10:23:59 2003] [error] mod_ruby: error in ruby
(eval): uninitialized constant ERubyRun at Apache (NameError)
from ruby:0:in `value’

I found a couple of messages in the archives from people with the same
problem, but no solution other than a pasted config from someone for
whom it worked.

handle *.rhtml as eruby files.

<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance


Ian Macdonald | All that glitters is not gold; all that
ian@caliban.org | wander are not lost.
>
>
>

Ian,

did you figure out why ERuby would not Run? i’ve seen this error before, but
can’t recall what i did to fix it. sorry. i probably used apt-get instead of
compiling and the problem went away. the debian advantage :wink:

···


tom sawyer, aka transami
transami@transami.net

Yes. I was simply missing the line:

RubyRequire apache/eruby-run

Ian

···

On Fri 31 Jan 2003 at 22:55:56 +0900, Tom Sawyer wrote:

did you figure out why ERuby would not Run? i’ve seen this error before, but
can’t recall what i did to fix it. sorry. i probably used apt-get instead of
compiling and the problem went away. the debian advantage :wink:


Ian Macdonald | When it is incorrect, it is, at least
ian@caliban.org | authoritatively incorrect. – Hitchiker’s
> Guide To The Galaxy
>
>

good! i should have caught that myself!

···

On Friday 31 January 2003 09:36 am, Ian Macdonald wrote:

RubyRequire apache/eruby-run


tom sawyer, aka transami
transami@transami.net