Ruby / FastCGI Problem

Discussion in 'Server Operation' started by Chad, Mar 7, 2008.

  1. Chad

    Chad New Member

    I tried to install my rails application. However it does not work
    properly (the rails welcome screen's "About your application
    environment" link gives a "Application error Rails application failed
    to start properly" message), and the error log shows plenty of FastCGI
    warnings and fcg incomplete header errors:


    [Thu Mar 6 07:44:20 2008] [warn] FastCGI: (dynamic) server
    "/home/username/public_html/jaspis/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 Mar 6 07:39:47 2008] [error] [client 91.120.172.159] FastCGI: incomplete
    headers (0 bytes) received from server
    "/home/username/public_html/jaspis/public/dispatch.fcgi"
    [Thu Mar 6 07:39:47 2008] [warn] FastCGI: (dynamic) server
    "/home/username/public_html/jaspis/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 Mar 6 07:39:47 2008] [error] [client 91.120.172.159] FastCGI: comm with
    (dynamic) server
    "/home/username/public_html/jaspis/public/dispatch.fcgi" aborted:
    (first read) idle timeout (30 sec)



    Code:
    /usr/local/bin/ruby -v
    ruby 1.8.5 (2006-08-25) [i686-linux]
    
    whereis ruby          
    ruby: /usr/bin/ruby /usr/lib/ruby /usr/local/bin/ruby /usr/local/lib/ruby /usr/local/ruby /usr/man/man1/ruby.1
    
    ./dispatch.fcgi
    ./dispatch.fcgi:21:in `require': no such file to load -- ./../config/environment (LoadError)
            from ./dispatch.fcgi:21
    Code:
    root@server [/home/user/public_html/dir]# ls -lh
    total 68K
    drwxr-xr-x  13 user user 4.0K Mar  5 04:29 ./
    drwxr-x---   7 user nobody   4.0K Mar  6 10:49 ../
    drwxr-xr-x   6 user user 4.0K Mar  4 08:28 app/
    drwxr-xr-x   4 user user 4.0K Mar  6 10:33 config/
    drwxr-xr-x   3 user user 4.0K Mar  4 08:56 db/
    drwxr-xr-x   2 user user 4.0K Mar  4 08:28 doc/
    drwxr-xr-x   3 user user 4.0K Mar  4 08:56 lib/
    drwxr-xr-x   2 user user 4.0K Mar  4 08:28 log/
    drwxr-xr-x   5 user user 4.0K Mar  6 10:43 public/
    -rw-r--r--   1 user user  307 Mar  4 08:28 Rakefile
    -rw-r--r--   1 user user 8.7K Mar  4 08:28 README
    drwxr-xr-x   4 user user 4.0K Mar  4 08:28 script/
    drwxr-xr-x   7 user user 4.0K Mar  4 08:28 test/
    drwxrwxrwx   6 user user 4.0K Mar  4 08:28 tmp/
    drwxr-xr-x   3 user user 4.0K Mar  4 08:28 vendor/
    Code:
    root@server [/home/user/public_html/dir/config]# ls -lh
    total 32K
    drwxr-xr-x   4 user user 4.0K Mar  6 10:33 ./
    drwxr-xr-x  13 user user 4.0K Mar  5 04:29 ../
    -rw-r--r--   1 user user 2.7K Mar  4 08:28 boot.rb
    -rw-r--r--   1 user user  638 Mar  6 10:33 database.yml
    -rw-r--r--   1 user user 2.8K Mar  6 04:31 environment.rb
    drwxr-xr-x   2 user user 4.0K Mar  4 08:47 environments/
    drwxr-xr-x   2 user user 4.0K Mar  4 08:28 initializers/
    -rw-r--r--   1 user user 1.6K Mar  4 08:46 routes.rb




    Files in the config directory have all -rw-r--r-- (644), subdirectories have
    755, the files in the environments subdirectory all have 644 permissions.

    Owner is username, group is username in all cases.

    I have now changed the shebang line of dispatch.fcgi from:
    #!/usr/bin/ruby to
    #!/usr/local/bin/ruby
    I also did this with the dispatch.rb and the dispatch.cgi

    The issue continues and I'm finding it rather difficult to trace the immediate
    cause of this fastcgi module issue. Your assistance is appreciated.



    Specs:
    Centos 5 / Cpanel 11 / PHP 5 / MYSQL 5
     
    Last edited: Mar 7, 2008
  2. falko

    falko Super Moderator Howtoforge Staff

    What's in /home/username/public_html/jaspis/public/dispatch.fcgi?
     

Share This Page