Ruby on Rails & FastCGI 500 Error

I’m getting an error 500 and I’m at my wits end as to what could be
causing it. I’m sure the path to the ruby executable is correct so what
else could be causing it?

Do you have a stack trace or anything more concrete than a 500 error?

Check your log files in the /log directory. If they don’t get bigger,
then there’s a permissions problem.

If you don’t get any clues from either your Rails application logfile,
or from your server’s error logfile, things to check for are

  • stale sessions with unloadable objects in them - clear all your
    sessions
  • puts statements in your code - FastCGI throws a hissyfit if you
    output anything via puts that it doesn’t expect

HTH

  • james

I run ruby -d ./dispatch.fcgi and I get the following:

Exception NameError' at ./../config/boot.rb:14 - uninitialized constant Rails /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/validations.rb:334: warning:*’ interpreted as argument prefix
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/validations.rb:363:
warning: *' interpreted as argument prefix /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/migration.rb:224: warning: instance variable @ignore_new_methods not initialized /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/migration.rb:224: warning: instance variable @ignore_new_methods not initialized /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:41: warning: method redefined; discarding old allow_concurrency= /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/sqlserver_adapter.rb:456: warning: method redefined; discarding old remove_column ExceptionMissingSourceFile’ at
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no
such file to load – db2/db2cli
Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no such file to load -- db2/db2cli ExceptionMissingSourceFile’ at
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150

  • no such file to load – db2/db2cli
    /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/oracle_adapter.rb:119:
    warning: (…) interpreted as grouped expression
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- oci8 ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – oci8
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – oci8
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- oci8 ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – oci8
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – oci8
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/kernel/requires.rb:19
  • no such file to load – oci8
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- sybsql ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – sybsql
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – sybsql
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/request.rb:169:
    warning: method redefined; discarding old relative_url_root
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- Win32API ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – Win32API
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – Win32API
    /usr/local/lib/ruby/1.8/cgi/session/pstore.rb:17: warning: method
    redefined; discarding old []=
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/cgi_ext/raw_post_data_fix.rb:57:
    warning: ambiguous first argument; put parentheses or even spaces
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/cgi_ext/raw_post_data_fix.rb:8:
    warning: method redefined; discarding old initialize_query
    Exception DRb::DRbServerNotFound' at /usr/local/lib/ruby/1.8/drb/drb.rb:1647 - DRb::DRbServerNotFound ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no
    such file to load – memcache
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no such file to load -- memcache ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – memcache
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session/active_record_store.rb:129:
    warning: private attribute?
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_controller/session/active_record_store.rb:179:
    warning: method redefined; discarding old connection
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_view/helpers/prototype_helper.rb:640:
    warning: ambiguous first argument; put parentheses or even spaces
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.3/lib/action_view/helpers/prototype_helper.rb:873:
    warning: *' interpreted as argument prefix ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no
    such file to load – redcloth
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no such file to load -- redcloth ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – redcloth
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- redcloth ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – redcloth
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – redcloth
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/kernel/requires.rb:19
  • no such file to load – redcloth
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- bluecloth ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – bluecloth
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – bluecloth
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- bluecloth ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – bluecloth
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – bluecloth
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/core_ext/kernel/requires.rb:19
  • no such file to load – bluecloth
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- html/tokenizer ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – html/tokenizer
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – html/tokenizer
    /usr/local/lib/ruby/gems/1.8/gems/actionmailer-1.2.3/lib/action_mailer/vendor/tmail/facade.rb:486:
    warning: method redefined; discarding old create_reply
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- tmail/base64.so ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – tmail/base64.so
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – tmail/base64.so
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- tmail/scanner_c.so ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – tmail/scanner_c.so
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – tmail/scanner_c.so
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- xml/parser ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – xml/parser
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – xml/parser
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no such file to load -- xml/parser ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – xml/parser
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- xmlscan/scanner ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – xmlscan/scanner
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – xmlscan/scanner
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no such file to load -- xmlscan/scanner ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – xmlscan/scanner
    Set XSD::XMLParser::REXMLParser as XML processor.
    Exception MissingSourceFile' at /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no such file to load -- http-access2 ExceptionMissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35 - no
    such file to load – http-access2
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:150
  • no such file to load – http-access2
    Loading http-access2 failed. Net/http is used.
    /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.4/lib/action_web_service/protocol/xmlrpc_protocol.rb:6:
    warning: discarding old message
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/initializer.rb:581:
    warning: method redefined; discarding old []=
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/initializer.rb:590:
    warning: method redefined; discarding old []
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/initializer.rb:595:
    warning: method redefined; discarding old keys
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/initializer.rb:600:
    warning: method redefined; discarding old find_pair
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/initializer.rb:607:
    warning: method redefined; discarding old []=
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/initializer.rb:611:
    warning: method redefined; discarding old []
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/initializer.rb:615:
    warning: method redefined; discarding old method_missing
    /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.4/lib/initializer.rb:483:
    warning: instance variable @after_initialize_block not initialized
    Exception `MissingSourceFile’ at
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27 - no
    such file to load – fcgi

Nothing more. Nothing less.

And in the cPanel “Error Log” I get:

[Thu Jul 20 14:02:08 2006] [error] [client 202.7.183.132] FastCGI:
incomplete headers (0 bytes) received from server
“/home/online/public_html/site2/public/dispatch.fcgi”
[Thu Jul 20 14:39:45 2006] [warn] FastCGI: (dynamic) server
“/home/online/public_html/site2/public/dispatch.fcgi” has failed to
remain running for 30 seconds given 3 attempts, its restart interval has
been backed off to 600 seconds
[Thu Jul 20 14:34:45 2006] [warn] FastCGI: (dynamic) server
“/home/online/public_html/site2/public/dispatch.fcgi” (pid 24184)
terminated by calling exit with status ‘1’
[Thu Jul 20 14:34:45 2006] [warn] FastCGI: (dynamic) server
“/home/online/public_html/site2/public/dispatch.fcgi” (uid 32142, gid
32143) restarted (pid 24184)