Uninitialized constant RailsFCGIHandler


#1

Hello, I’m trying to switch to FastCGI.

With CGI everything works, but after have done all the steps of the wiki
here
(http://wiki.rubyonrails.org/rails/pages/RailsOnUbuntuDebianTestingAndUnstable)

My application started to give me “Error 500”

Looking at the Apache logs I can see :

[notice] mod_fcgid: server /rails/public/dispatch.fcgi(6127) started

/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:200:in
`const_missing’: uninitialized constant RailsFCGIHandler (NameError)
from /rails/public/dispatch.fcgi:25

[notice] mod_fcgid: process /rails/public/dispatch.fcgi(6127)
exit(communication error), terminated by calling exit(), return code: 1

The environment is :
Ubuntu - Apache 2 - Gem 0.8.11 - Ruby 1.8.3

Any ideas ?

Simone


#2

On 19 Feb 2006, at 16:57, Simone F. wrote:

The environment is :
Ubuntu - Apache 2 - Gem 0.8.11 - Ruby 1.8.3

Ubuntu likes you to call the “fastcgi-script” “fcgid-script .fcgi”.

so go to the public/.htaccess file and change the line:
=> AddHandler fastcgi-script .fcgi

at the top of the file to:
=> AddHandler fcgid-script .fcgi

thats what I have to do on my Ubuntu breezy dev. server.

David S.
w: http://davidsmalley.com/blog


#3

David S. wrote:

Ubuntu likes you to call the “fastcgi-script” “fcgid-script .fcgi”.

so go to the public/.htaccess file and change the line:
=> AddHandler fastcgi-script .fcgi

at the top of the file to:
=> AddHandler fcgid-script .fcgi

It’s already like this :frowning:

Any other advice ?

Simone


#4

David S. wrote:

On 20 Feb 2006, at 08:36, Simone F. wrote:
Have you done “gem install fcgi”?

Yes, I did this as well … :frowning:

Simone


#5

On 20 Feb 2006, at 08:36, Simone F. wrote:

David S. wrote:

Ubuntu likes you to call the “fastcgi-script” “fcgid-script .fcgi”.

so go to the public/.htaccess file and change the line:
=> AddHandler fastcgi-script .fcgi

at the top of the file to:
=> AddHandler fcgid-script .fcgi

It’s already like this :frowning:

Have you done “gem install fcgi”?

David S.
w: http://davidsmalley.com/blog


#6

On 2/20/06, Simone F. removed_email_address@domain.invalid wrote:

David S. wrote:

On 20 Feb 2006, at 08:36, Simone F. wrote:
Have you done “gem install fcgi”?

Yes, I did this as well … :frowning:

Simone

If you run “ruby dispatch.fcgi” directly from the command line you
should get “Status: 500 Internal Server Error.” due to the lack of a
webserver driving dispatch.fcgi.

If instead it blows up, you have a basic fcgi setup issue.

If you are getting the above, then I think you are having a website
configuration issue.

Greg

Greg F.
The Norcross Group
Forensics for the 21st Century


#7

On 21 Feb 2006, at 08:27, Simone F. wrote:

Greg F. wrote:

If you run “ruby dispatch.fcgi” directly from the command line you
should get “Status: 500 Internal Server Error.” due to the lack of a
webserver driving dispatch.fcgi.

This is what I do to debug a new application when I set it up and
something goes wrong. Normally a bit more verbose than looking in
apache logs

Hej, I create a new rails app on my system and that error disappeared
… but a new one came out :frowning:

I know that on my mac some modules put themselves into

/usr/lib/ruby/site_ruby/1.8/…

but the main ruby install is in

/usr/lib/ruby/1.8

As its just a few extra modules in /site_ruby i have symlinked them
into the /1.8 folder.

Have a look in /usr/lib/ruby (or /usr/local/lib/ruby ) and see what
your setup is. Perhaps your app is looking in site_ruby but your ruby
install is in 1.8?

David

David S.
w: http://davidsmalley.com/blog


#8

Greg F. wrote:

If you run “ruby dispatch.fcgi” directly from the command line you
should get “Status: 500 Internal Server Error.” due to the lack of a
webserver driving dispatch.fcgi.

If instead it blows up, you have a basic fcgi setup issue.

If you are getting the above, then I think you are having a website
configuration issue.

Hej, I create a new rails app on my system and that error disappeared
… but a new one came out :frowning:

I posted it here : http://www.ruby-forum.com/topic/55353#37588

Simone


#9

If you run “ruby dispatch.fcgi” directly from the command line you
should get “Status: 500 Internal Server Error.” due to the lack of a
webserver driving dispatch.fcgi.

If instead it blows up, you have a basic fcgi setup issue.

If you are getting the above, then I think you are having a website
configuration issue.

And what would that basic fcgi setup issue be?

When I run dispatch.fcgi or try to run the script from my browser this
appears in my apache error logs:

[notice] mod_fcgid: process
/usr/local/www/vhosts/shallotsanctuary.com/httpdocs/dispatch.fcgi(79949)
exit(communication error), terminated by calling exit(), return code:
120

And if I run from the commandline, I get:

/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:266:in
`load_missing_constant’: uninitialized constant RailsFCGIHandler
(NameError)

Of course, if I use ruby -d, it certainly does “blow up”.