Setup problem


#1

I am trying to set up rails and am have problems. I have googled
everything I could think of, but have not found my problem. Here are my
specs.

Gentoo Linux 2006.0
Apache 2.2
Ruby 1.8.4
Gems 1.8
Rails 1.1.2
mod_fcgid 1.08

When I try to access my test rails app through the webserver, I get the
following error in the error.log (after seeing a html 500 error on the
page).

[Fri Apr 14 19:54:48 2006] [notice] mod_fcgid: server
/var/www/rails/cookbook/public/dispatch.fcgi(20039) started
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in
const_missing': uninitialized constant RailsFCGIHandler (NameError) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:inconst_missing’
from /var/www/rails/cookbook/public/dispatch.fcgi:25

I have seen suggestions to run ‘ruby dispatch.fcgi’ from the command
line, but I get the same error.

Any suggestions?


#2

Have you installed the fastcgi dev kit and ruby bindings?


Joe C.
RailsPlayground.com


#3

I installed everything the WiKi said.

Apache
mod_fcgid
fcgi
gems
ruby
rails gem
fcgi gem

Is there something else I need?


#4

Any ideas anyone?

Thanks.


#5

home equity line of credit


#6

I had the exact same side effect when the fcgi gem wasn’t installed…
so I’d be suspcicious about that gem… maybe it’s not installed
correctly?


#7

Ok, I fixed it!

My dispatch.fcgi file originally read:

RailsFCGIHandler.process! ‘/var/log/myapp_fcgi_crash.log’
require File.dirname(FILE) + “/…/config/environment”
require ‘fcgi_handler’

RailsFCGIHandler.process!

And something didn’t seem right about that, so I tested a theory:

require File.dirname(FILE) + “/…/config/environment”
require ‘fcgi_handler’
RailsFCGIHandler.process! ‘/var/log/myapp_fcgi_crash.log’

RailsFCGIHandler.process!

Guess what! That fixed it, and I wasted an entire day on this. I’m
submitting a bug right after posting this.

Cheers,
Michael


#8

Anonymous wrote:

I had the exact same side effect when the fcgi gem wasn’t installed…
so I’d be suspcicious about that gem… maybe it’s not installed
correctly?

I have the exact same problem:
root public# ./dispatch.fcgi
./dispatch.fcgi:19: uninitialized constant RailsFCGIHandler (NameError)
root public#

And I do have fcgi installed:
root public# gem list

*** LOCAL GEMS ***

actionmailer (1.3.3)
Service layer for easy email delivery and testing.

actionpack (1.13.3)
Web-flow and rendering framework putting the VC in MVC.

actionwebservice (1.2.3)
Web service support for Action Pack.

activerecord (1.15.3)
Implements the ActiveRecord pattern for ORM.

activesupport (1.4.2)
Support and utility classes used by the Rails framework.

cgi_multipart_eof_fix (2.3)
Fix an exploitable bug in CGI multipart parsing.

fastthread (1.0)
Optimized replacement for thread.rb primitives

fcgi (0.8.7)
FastCGI library for Ruby.

fcgiwrap (0.1.5)
A trick to wrap CGI in FastCGI easily

flvtool2 (1.0.6)
Flash video (FLV) manipulation tool

gem_plugin (0.2.2)
A plugin system based only on rubygems that uses dependencies only

highline (1.4.0)
HighLine is a high-level command-line IO library.

needle (1.3.0)
Needle is a Dependency Injection/Inversion of Control container for
Ruby. It supports both type-2 (setter) and type-3 (constructor)
injection. It takes advantage of the dynamic nature of Ruby to
provide a rich and flexible approach to injecting dependencies.

rails (1.2.3)
Web-application framework with template engine, control-flow layer,
and ORM.

rake (0.7.3)
Ruby based make-like utility.

rubyforge (0.4.4)
A script which automates a limited set of rubyforge operations.

sources (0.0.1)
This package provides download sources for remote gem installation
root public#

So this isn’t a web service problem, it’s a ruby not loading with it’s
own fcgi gem. I installed it by running
root public# gem install fcgi

Then I again tried installing manually, by downloading the tgz and
manually building it. It built without errors, and still the same
result. Has anyone got this to work?