[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Troubleshooting eruby

Albert

1/11/2005 3:58:00 AM

Hello all.

I've been trying to use eruby lately for my website. I installed a
userspace copy of Ruby 1.8.2 and the latest eruby, following the
instructions as per http://tinyurl...

So I can get Ruby scripts working fine (.rbx files) and if I add the
shebang to .rhtml files and make them executable I can get them to work
too. But plain .rhtml files end up confusing the server. I get the
following error message:

File does not exist: /home/albert/public_html/cgi/eruby/GetEnv.rhtml

where GetEnv.rhtml is sitting in public_html and eruby is the exectuable.
It's almost as if Apache can't figure out that eruby is the executable.

Manually running eruby shows no problems. I think this is an Apache
configuration thing, and I really hope it can be solved via .htaccess
instead of me going through the hassle of begging my host to change his
httpd.conf. Any ideas?
3 Answers

Mike Sassak

1/11/2005 5:20:00 AM

0

Hi,

This is probably a silly question, but is GetEnv.rhtml sitting in
public_html/ as described above, or in public_html/cgi/eruby/? If
that's the case, you may need a .htaccess file in public_html/ with
the requisite eruby directives, because .htaccess only affects the
current directory and those below it.

Anyway... this may be a mime-type problem. Looking at the link you
gave, the processing of .rhtml files depends on Apache being able to
correctly identify them as mime-type application/x-httpd-eruby. You
could add that in your .htaccess file using the AddType directive, if
your server admin allows it.

-mike

On Tue, 11 Jan 2005 13:01:20 +0900, Albert <albert@moetry.nospam.org> wrote:
> Hello all.
>
> I've been trying to use eruby lately for my website. I installed a
> userspace copy of Ruby 1.8.2 and the latest eruby, following the
> instructions as per http://tinyurl...
>
> So I can get Ruby scripts working fine (.rbx files) and if I add the
> shebang to .rhtml files and make them executable I can get them to work
> too. But plain .rhtml files end up confusing the server. I get the
> following error message:
>
> File does not exist: /home/albert/public_html/cgi/eruby/GetEnv.rhtml
>
> where GetEnv.rhtml is sitting in public_html and eruby is the exectuable.
> It's almost as if Apache can't figure out that eruby is the executable.
>
> Manually running eruby shows no problems. I think this is an Apache
> configuration thing, and I really hope it can be solved via .htaccess
> instead of me going through the hassle of begging my host to change his
> httpd.conf. Any ideas?
>
>


Dimitri Aivaliotis

1/11/2005 3:55:00 PM

0

On Tue, 11 Jan 2005 13:01:20 +0900, Albert <albert@moetry.nospam.org> wrote:
> Hello all.
>
> I've been trying to use eruby lately for my website. I installed a
> userspace copy of Ruby 1.8.2 and the latest eruby, following the
> instructions as per http://tinyurl...
>

This is a post from 2002 - I think it's quite dated...

> So I can get Ruby scripts working fine (.rbx files) and if I add the
> shebang to .rhtml files and make them executable I can get them to work
> too. But plain .rhtml files end up confusing the server. I get the
> following error message:
>
> File does not exist: /home/albert/public_html/cgi/eruby/GetEnv.rhtml
>

It sounds like it's trying to execute the script via a cgi named
eruby, which doesn't exist. This shouldn't happen. There's an Apache
misconfiguration here somewhere.

> where GetEnv.rhtml is sitting in public_html and eruby is the exectuable.
> It's almost as if Apache can't figure out that eruby is the executable.
>

eruby should not be called on as an executable (it's a handler within mod_ruby)

> Manually running eruby shows no problems. I think this is an Apache
> configuration thing, and I really hope it can be solved via .htaccess
> instead of me going through the hassle of begging my host to change his
> httpd.conf. Any ideas?
>
>

All that should be necessary is:

<IfModule mod_ruby.c>
RubyRequire apache/ruby-run
<FilesMatch ".rbx">
Options +ExecCGI
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</FilesMatch>
RubyRequire apache/eruby-run
<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>
</IfModule>


If you've got the *.rbx part working, try just putting the eruby and
*.rhtml relevant parts in your .htaccess file.

- Dimitri


Albert

1/12/2005 11:46:00 PM

0

Albert <albert@moetry.nospam.org> wrote in
news:Xns95DAEA0379816albertmoetryorg@140.99.99.130:

> Hello all.
>
> I've been trying to use eruby lately for my website. I installed a
> userspace copy of Ruby 1.8.2 and the latest eruby, following the
> instructions as per http://tinyurl...
>
> ...

Just a quick followup, after reading the Apache docs for awhile I tried
renaming eruby to eruby.cgi and it seems to have done the trick. Go
figure. Thanks for the responses everyone.