Apache / FastCGI freak out in PRODUCTION mode on my new rail

Here I go again with another question. I’ve been banging my head for the
better part of a week against this one, so responses would be really

I have a Rails application that I’ve been developing under
Apache/FastCGI in
development mode. All is well and works wonderfully, until I change my
httpd.conf from this:

FastCgiServer /var/www/genselect/public/dispatch.fcgi \ -initial-env RAILS_ENV=development \ -processes 2 \ -idle-timeout 60

To this:

FastCgiIpcDir /tmp/fcgi_ipc FastCgiServer /var/www/genselect/public/dispatch.fcgi \ -initial-env RAILS_ENV=production \ -processes 2 \ -idle-timeout 60

When I do that, the site won’t come up at all in my browser and I get
in my apache error_log:

[Mon Dec 12 19:01:09 2005] [error] [client] FastCGI: comm
server “/var/www/genselect/public/dispatch.fcgi” aborted: idle timeout
[Mon Dec 12 19:01:09 2005] [error] [client] FastCGI:
headers (0 bytes) received from server

I have another rails application running in production mode on the same
machine, and it works fine - so I know how to get it done. I’ve even
my previous rails app from the httpd.conf to test if there is some sort
FCGI collision going on, but there’s not - my new app still fails to
up in production mode.

My old rails app is something I started on 0.13 (and I’m pretty sure I
haven’t updated). I noticed the environment.rb files are very different
between the two, but the 0.13 one still works just fine. (My new rails
is 0.14.4)

My database settings are all kosher (I’ve even pointed production /
development mode to the same database with no luck), and I’ve cleared
sessions out of my DB between restarts.

I’ve commented everything out of production.rb, but still no luck. I’m
crazy here - does anyone have an idea what could be causing my problems?

Alright - I feel really stupid, but I just solved it literally seconds
I posted the message.

Someone on the irc channel suggested that I run webrick in prodcution
It gave me this

`establish_connection’: production database is not configured

So I checked out my database.yml file again and found out that I had a
on the line between test and production mode, and THAT was causing the

Just in case someone else has the same problem one day - look at your
database.yml file really closely.

On 12/12/05 10:22 PM, “subimage interactive” removed_email_address@domain.invalid wrote:

I’ve commented everything out of production.rb, but still no luck. I’m going
crazy here - does anyone have an idea what could be causing my problems?

A few notes that might help…

I’m personally having an issue wherein I’m using a very similar FastCGI
config line, but it’s not passing the production flag over to the app
properly – and thus is was always trying to start in development. Mine
looks like:

FastCgiIpcDir /tmp/fcgi_ipc FastCgiServer /webserver/cbwebsite/releases/rel29/public/dispatch.fcgi \ -initial-env RAILS_ENV=production -processes 5 -idle-timeout 120

To fix it I’ve temporarily told Rails to run in production by hand in
environment.rb file but I’d really like to know why the above isn’t

Some issues I ran into before but are now solved:

For some reason the temp folder (/tmp/fcgi_ipc) was initially owned by
user, and then when I tried to boot the server www couldn’t write into
it. I
deleted it, restarted apache and only then could it create a new folder
was owned by www and would work.

Finally, another issue I once has was the shebang line in dispatch.fcgi

it was pointed to a previous ruby install, and not my current one which
where to find FastCGI.

Good luck.

~ Mike