# mod\_ruby/RailsDispatcher problems

**URL:** <https://www.ruby-forum.com/t/mod-ruby-railsdispatcher-problems/77988>\
**Category:** Rails\
**Created:** [December 2, 2006, 6:24am UTC](https://www.ruby-forum.com/t/mod-ruby-railsdispatcher-problems/77988 "2006-12-02T06:24:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![reflex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@reflex](https://www.ruby-forum.com/u/reflex)\
**Post date:** [December 2, 2006, 6:24am UTC](https://www.ruby-forum.com/t/mod-ruby-railsdispatcher-problems/77988/1 "2006-12-02T06:24:47Z")

</div>

Hello

I’m having some trouble trying to configure mod\_ruby 1.2.6 with  
RailsDispatcher. When I access my application, the browser shows the  
contents of dispatch.rb.

Here’s the configuration I’m using:

RubySafeLevel 0  
RubyRequire rubygems  
RubyRequire apache/rails-dispatcher  
RubyTransHandler Apache::RailsDispatcher.instance

 ServerName myapp.foo.com ServerAlias www.myapp.foo.com

DocumentRoot /var/www/rails/myapp/public/

\<Directory /var/www/rails/myapp/public/\>  
Options ExecCGI FollowSymLinks IncludesNOEXEC Indexes  
AllowOverride All  
Order allow,deny  
Allow from all

SetHandler ruby-object  
RubyHandler Apache::RailsDispatcher.instance  
RubyOption rails\_uri\_root /  
RubyOption rails\_root /var/www/rails/myapp  
RubyOption rails\_env production

SetOutputFilter DEFLATE

I did some debugging in rails-dispatcher.rb, and in the #handler method,  
I noticed it’s returning DECLINED at the beginning, because the  
r.filename contains the whole path to dispatch.rb, and thus doesn’t  
match /\Adispatch.(cgi|fcgi|rb)\z/. Anyone seen this problem too?  
Removing the “\A” from the regex makes it match, and it works somehow,  
but I get some strange errors (stack level too deep in the templates)  
which  
don’t happen in CGI mode.

Anything obvious I could be missing? Anyone using RailsDispatcher at  
all?

Thanks  
Andre
