Forum: Ruby on Rails trouble with fastcgi and "undefined method `is_cgi?'"

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D7765fa0920a356b7397acf8e5f2218d?d=identicon&s=25 Brian Sammon (Guest)
on 2005-12-20 20:41
(Received via mailing list)
I'm trying to get started with fastcgi on apache 2.0.54 on Fedora Core
4.
I've created a really simple Rails app that doesn't do any database
actions.
It works fine when I call it as CGI, but when I try to switch to
fastCGI, I
have problems.

I get the following error in log/fastcgi.crash.log:
  [20/Dec/2005:10:16:53 :: 26912] Dispatcher failed to catch: undefined
method
`is_cgi?' for FCGI:Class (NoMethodError)
    /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:593:in `each_cgi'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
`process!'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:in
`process!'
    /var/www/html/test2/public/dispatch.fcgi:24
  killed by this error

There's a bunch of error messages in /var/log/httpd/error.log, but as
far as I
can tell, all they really say is that dispatch.fcgi died prematurely.

Here's (what I think is) the relevant snippet from the httpd.conf:
  LoadModule fastcgi_module modules/mod_fastcgi.so
  <IfModule mod_fastcgi.c>
      FastCgiIpcDir /tmp/fcgi_ipc/
      AddHandler fastcgi-script .fcgi
  </IfModule>
  <Directory "/var/www/html/test2">
    AllowOverride All
  </Directory>

Here's the rewrite stuff from public/.htaccess :
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

I'm running:
  rails 1.0.0
  fcgi (0.8.6.1)
  mod_fcgi 2.4.2
  fastcgi devel libraries 2.4.0
  apache 2.0.54
  Fedora Core 4

Any ideas?
D7765fa0920a356b7397acf8e5f2218d?d=identicon&s=25 Brian Sammon (Guest)
on 2005-12-20 22:15
(Received via mailing list)
This problem went away when I uninstalled the fcgi gem and used a
manually-installed fcgi instead.

This brings to mind a related question:
In the wiki at http://wiki.rubyonrails.com/rails/pages/fastcgi
it says
  in public/dispatch.fcgi change

    require 'fcgi'

  to

    require 'rubygems'
    require_gem 'fcgi'

as part of the fastcgi installation instructions.  Since there wasn't a
"require 'fcgi'" line in my public/dispatch.fcgi , I ignored this
instruction.
 There was, however, a "require 'fcgi_handler'"  Should I have replaced
that
line, and if so, with what?
This topic is locked and can not be replied to.