# Deployment problem with apache + fastcgi

**URL:** <https://www.ruby-forum.com/t/deployment-problem-with-apache-fastcgi/186274>\
**Category:** Rails\
**Created:** [April 3, 2010, 12:55pm UTC](https://www.ruby-forum.com/t/deployment-problem-with-apache-fastcgi/186274 "2010-04-03T12:55:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mozilla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@mozilla](https://www.ruby-forum.com/u/mozilla)\
**Post date:** [April 3, 2010, 12:55pm UTC](https://www.ruby-forum.com/t/deployment-problem-with-apache-fastcgi/186274/1 "2010-04-03T12:55:15Z")

</div>

Hi! I’m from Russia. It’s my first post in this forum. Execuse for my  
bad language, but i hope you’re help me!  
I try to deploy rails app on apache + fastcgi hosting.

.htaccess file contents:

AddHandler fcgid-script .fcgi  
AddHandler cgi-script .cgi

Options +FollowSymLinks +ExecCGI

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

Dispatch.fcgi file contents:

#!/usr/local/bin/ruby  
require File.dirname( **FILE** ) + “/…/config/environment”  
require ‘fcgi\_handler’  
RailsFCGIHandler.process! ‘/var/log/myapp\_fcgi\_crash.log’

For request: [http://mydomain/](http://mydomain/)  
i get “welcome ruby on rails page” with information about Rails, Ruby,  
Gems versions.

I renamed index.html in public directory and wrote default “root”  
controller in routes.rb. But there was an error.  
I get only:

NameError in [ControllerName]#[ActionName]  
uninitialized constant [ControllerName]

Session dump: —  
Framework Trace:  
usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active\_support/dependencies.rb:443:in  
`load_missing_constant' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active\_support/dependencies.rb:92:in  
`const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/inflector.rb:361:in `constantize’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active\_support/inflector.rb:360:in  
`each' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/inflector.rb:360:in `constantize’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active\_support/core\_ext/string/inflections.rb:162:in  
`constantize' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:443:in `recognize’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action\_controller/routing/route\_set.rb:436:in  
`call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:87:in `dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action\_controller/dispatcher.rb:121:in  
`_call' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:130 /usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in `call’  
/usr/local/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in  
`call’

etc.

It was for all controllers (for all requests).

Development.log:  
Processing ActionController::Base#index [GET]

NameError (uninitialized constant [ControllerName]):  
public/dispatch.fcgi:27

Rendered rescues/\_trace (45.1ms)  
Rendered rescues/\_request\_and\_response (0.4ms)  
Rendering rescues/layout (internal\_server\_error)

Please help me! Thanks!
