# Help - deploying on Apache1.3/FCGI - Dispatcher failed to ca

**URL:** <https://www.ruby-forum.com/t/help-deploying-on-apache1-3-fcgi-dispatcher-failed-to-ca/113336>\
**Category:** Deployment\
**Created:** [August 30, 2007, 12:32am UTC](https://www.ruby-forum.com/t/help-deploying-on-apache1-3-fcgi-dispatcher-failed-to-ca/113336 "2007-08-30T00:32:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [August 30, 2007, 12:32am UTC](https://www.ruby-forum.com/t/help-deploying-on-apache1-3-fcgi-dispatcher-failed-to-ca/113336/1 "2007-08-30T00:32:47Z")

</div>

Hi,  
I am in need to deploy Rails application on CentOS with Apache 1.3 and  
FCGI.  
Nothing happens except these in fast\_cgi\_crash log:

30/Aug/2007:00:25:24 :: 11521] Dispatcher failed to catch: You have a  
nil object when you didn’t expect it!  
ou might have expected an instance of Array.  
he error occurred while evaluating nil.split (NoMethodError)  
/usr/lib/ruby/1.8/cgi.rb:898:in `parse’

Application work as CGI, or webrick or mongrel, I tried with clean  
rails app (rails test) and tested with minimal test.fcgi and it all  
works.

thanks for any thought on these,  
Bojan

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [August 30, 2007, 1:59am UTC](https://www.ruby-forum.com/t/help-deploying-on-apache1-3-fcgi-dispatcher-failed-to-ca/113336/2 "2007-08-30T01:59:54Z")

</div>

What happens in ssh when youruby script/server from the public dir?  
It looks to me like you don’t have a htaccess file telling it to use  
fcgi  
instead of cgi.

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [August 30, 2007, 2:02am UTC](https://www.ruby-forum.com/t/help-deploying-on-apache1-3-fcgi-dispatcher-failed-to-ca/113336/3 "2007-08-30T02:02:54Z")

</div>

Sample htaccess that we use on one of the servers using apache 1.3 and  
fcgi:

# General Apache options

AddHandler fastcgi-script .fcgi  
AddHandler cgi-script .cgi  
Options +FollowSymLinks +ExecCGI

# Redirect all requests not available on the filesystem to Rails

# By default the cgi dispatcher is used which is very slow

# 

# For better performance replace the dispatcher with the fastcgi one

# 

# Example:

# RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]

RewriteEngine On

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

- Greg

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [August 30, 2007, 10:26am UTC](https://www.ruby-forum.com/t/help-deploying-on-apache1-3-fcgi-dispatcher-failed-to-ca/113336/4 "2007-08-30T10:26:36Z")

</div>

Do you have any other rails apps running on this server? I’m trying to  
determine if your fcgi processes are even working. Also check all your  
permissions. Can you post back your htaccess file?

- Greg

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [August 30, 2007, 3:37am UTC](https://www.ruby-forum.com/t/help-deploying-on-apache1-3-fcgi-dispatcher-failed-to-ca/113336/5 "2007-08-30T03:37:01Z")

</div>

Hi Greg,  
I can ruby script/server normally, and it works when I set it to cgi  
instead of fcgi. .htaccess is similiar to one you posted.  
But still no works ☹

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [August 30, 2007, 10:39am UTC](https://www.ruby-forum.com/t/help-deploying-on-apache1-3-fcgi-dispatcher-failed-to-ca/113336/6 "2007-08-30T10:39:41Z")

</div>

.htaccess

AddHandler fastcgi-script .fcgi  
AddHandler cgi-script .cgi  
Options +FollowSymLinks +ExecCGI  
RewriteRule ^$ index.html [QSA]  
RewriteRule ^([^.]+)$ $1.html [QSA]  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]  
ErrorDocument 500 “

## Application error
Rails application failed  
to start properly”

Permissions:  
-rwxr-xr-x 1 elansnow elansnow 855 Aug 30 00:25 dispatch.fcgi\*  
-rw-r–r-- 1 elansnow elansnow 1252 Aug 30 10:33 .htaccess

I do not have any other rails app on this machine. I have created  
minimal ruby script to test if FCGI is working and it seems it is as I  
get expected output from this:

#!/usr/bin/ruby  
require ‘rubygems’  
require “fcgi”  
FCGI.each\_cgi {|cgi|  
name = cgi[‘name’][0]  
puts cgi.header  
puts "You are #{name} " if name  
puts “Connecting from #{cgi.remote\_addr}”  
}

While when I start dispatch.fcgi from command line errors get written  
in fast\_cgi\_crash\_log and nothing more.

---

<div class="post-metadata">

**Author:** ![bmihelac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/5fc32e/32.png) [@bmihelac](https://www.ruby-forum.com/u/bmihelac)\
**Post date:** [August 30, 2007, 10:43am UTC](https://www.ruby-forum.com/t/help-deploying-on-apache1-3-fcgi-dispatcher-failed-to-ca/113336/7 "2007-08-30T10:43:46Z")

</div>

Ok. I don’t see anything wierd here.Check the first line of your  
dispatch.rb, dispatch.fcgi and dispatch.cgi files and make sure they are  
correctly pointing to ruby.

- Greg
