RoR on Apache not working

Hi
I’m a RoR newbie, in fact i’ve been using it for less than 24 hours, but
I’m not an internet/pc/apache/developement newbie so I expected this to
go much easier :slight_smile:
Ok, here it goes. I’ve been trying to get RoR working with apache both
on a RH server and after i didn;t managed there I tried on my machine,
an windows XP/Apache2 machine.
I don’t like running it from localhost, i want my app accessible from
the web and also i hate software that runs in command prompts that i
have to keep opened (WeBrick)
So, i followed many sets of explanations on how to do this, last one
beeing
http://wiki.rubyonrails.org/rails/pages/Fast+CGI+and+Apache2+for+Windows+without+VirtualHosts
It doesn’t work.
When i try to run the app in the browser it sais (this after beeing
incredibly slow to process my request):
Application error
Rails application failed to start properly

The error log in apache sais:
[Fri Jun 02 10:54:38 2006] [warn] FastCGI: server
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” (pid 5108)
terminated with exit with status ‘1’
[Fri Jun 02 10:54:38 2006] [warn] FastCGI: server
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” restarted (pid 5116)
[Fri Jun 02 10:54:42 2006] [warn] FastCGI: server
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” (pid 5116)
terminated with exit with status ‘1’
[Fri Jun 02 10:54:43 2006] [warn] FastCGI: server
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” restarted (pid 5124)
[Fri Jun 02 10:54:47 2006] [warn] FastCGI: server
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” (pid 5124)
terminated with exit with status ‘1’
[Fri Jun 02 10:54:47 2006] [warn] FastCGI: server
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” has failed to remain
running for 30 seconds given 3 attempts, its restart interval has been
backed off to 600 seconds

Actually the first 2 lines are from when apache starts.

The settings i’ve added in httpd.conf are:
Alias /clients “D:/work/#htdocs/ruby/clients/public”

<Directory “D:/work/#htdocs/ruby/clients/public”>
AddHandler fastcgi-script .fcgi
Options +ExecCGI
AllowOverride all
Allow from all
Order allow,deny

FastCgiServer D:/work/#htdocs/ruby/clients/public/dispatch.fcgi
-processes 1

And public/.htaccess

AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Sorry for the long message,i just thought of giving the whole info
before asking for help, so that you guys can identify any stupid mistake
i might have made.
Also, i’ve tried first without fastcgi, that didn;t work too, the error
i saw in browser was:
Routing Error

Recognition failed for “”

All this errors i’m getting when I try to access parts of my app that
work ok on webrick on port 3000.
Ok, thanks for your patience and i hope i can get ruby to work on apache
:slight_smile:

bye

I found that I had similar problems when my .htaccess duplicated stuff
in my httpd.conf.

Have a go with my Rails Prod Win setup kit, it does exactly what you
want to do:

It installs, Ruby + Rails + Apache and FCGI pre-setup for you.

You want to remove anything you have installed before installing this
though. Just keep the rails application, not rails itself but your
application.

hope this help

Gael

Kfir L. wrote:

Hi,
Edit the files:
D:/work/#htdocs/ruby/clients/public/dispatch*

Check that first line of each file points to ruby as a windows path.
e.g: #!D:\ruby\bin\ruby

kfir

Erm… no
Ruby is installed on C, in C:\Ruby, Apache is also on C. Only htdocs is
on D because i’ve learnt not to keep anything valuable on the system
partition, in windows, this way i only loose 1 hour to wipe C and
reinstall.

I guess i’ll take on that advice to install the package that comes with
apache.
Thanks for all the answers.

Hi,
Edit the files:
D:/work/#htdocs/ruby/clients/public/dispatch*

Check that first line of each file points to ruby as a windows path.
e.g: #!D:\ruby\bin\ruby

kfir