# 500 Error running the dispatchers in Apache?

**URL:** <https://www.ruby-forum.com/t/500-error-running-the-dispatchers-in-apache/50208>\
**Category:** Rails\
**Created:** [December 14, 2005, 6:19am UTC](https://www.ruby-forum.com/t/500-error-running-the-dispatchers-in-apache/50208 "2005-12-14T06:19:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebzilla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@sebzilla](https://www.ruby-forum.com/u/sebzilla)\
**Post date:** [December 14, 2005, 6:19am UTC](https://www.ruby-forum.com/t/500-error-running-the-dispatchers-in-apache/50208/1 "2005-12-14T06:19:11Z")

</div>

I am running Rails 0.14.3 on a RedHat Linux server (at Rackspace if it  
matters).

I have a completely vanilla installation of Rails set up, with one  
controller and an index method that does nothing and a template that  
just outputs “Hello!”. Nothing fancy.

When I load up WEBrick, I can hit the controller URL and it works fine.  
I see my template, all is well.

When I hit the controller URL via Apache (1.3.27), I get a “Status: 500  
Internal Server Error”. Nothing at all appears in the  
log/development.log file either.

Now this is running on a virtual host, and I have confirmed that all my  
suexec permissions are correct (in fact if I put a small “Hello World”  
Ruby CGI in the folder, with all the same ownership and permissions, it  
runs fine - I am fairly confident this isn’t the problem).

So I started tracing back through the Rails codebase from the  
dispatch.cgi file, outputting some messages as I went, to figure out  
where the script was actually failing. I inspected the cgi object that  
is returned in the ‘dispatch’ method in dispatcher.rb in the actual  
rails gem, and it looks like this:

#CGI:0x409fb4b0 @multipart=false,  
@cookies={"\_\_utma"=\>[“11232945.1217992048.1134517517.1134517517.1134517517.1”],  
“\_session\_id”=\>[“598ed6bd708ed7ca716350153e277926”],  
“\_\_utmc”=\>[“11232945”],  
“\_\_utmz”=\>[“11232945.1134517517.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)”]},  
@output\_hidden=nil, @output\_cookies=nil, @params={}

The request object looks like this:

#ActionController::CgiRequest:0x409fb4d8  
@session\_options={:session\_path=\>"/", :prefix=\>“ruby\_sess.”,  
:database\_manager=\>CGI::Session::PStore}, @cgi=#\<CGI:0x409fb4b0  
@multipart=false,  
@cookies={"\_\_utma"=\>[“11232945.1217992048.1134517517.1134517517.1134517517.1”],  
“\_session\_id”=\>[“598ed6bd708ed7ca716350153e277926”],  
“\_\_utmc”=\>[“11232945”],  
“\_\_utmz”=\>[“11232945.1134517517.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)”]},  
@output\_hidden=nil, @output\_cookies=nil, @params={}

Now, where this actually falls apart is during the process that happens  
a few lines lower, here:

ActionController::Routing::Routes.recognize!(request).process(request,  
response).out(output)

I managed to figure out (I think) that the process command is being  
executed on a returned object of type controller, in  
actionpack/lib/controller/action\_controller/base.rb

Within there I followed it to the “assign\_shortcuts” method (which takes  
the request and response objects as parameters) and it fails on the line

@response.session = request.session

If I put in output before that line, it works fine, if I put output  
after that line, it doesn’t show up, so this seems to be where the  
exception is being thrown?

I continued to dig into the session stuff a bit but that’s when I got  
totally lost. My controller isn’t even starting up a session, unless  
this happens automatically?

Any help would be greatly appreciated, I feel I’m so close to getting  
this going, but I’m still new-ish to Ruby and to Rails as well…

Thanks alot,  
Seb

---

<div class="post-metadata">

**Author:** ![sebzilla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@sebzilla](https://www.ruby-forum.com/u/sebzilla)\
**Post date:** [December 14, 2005, 6:58am UTC](https://www.ruby-forum.com/t/500-error-running-the-dispatchers-in-apache/50208/2 "2005-12-14T06:58:41Z")

</div>

Seb Barre wrote:

> totally lost. My controller isn’t even starting up a session, unless  
> this happens automatically?

Try deleting old sessions. On Unix, /tmp/ruby\_sess\*

–  
We develop, watch us RoR, in numbers too big to ignore.
