Can't set up rails: dispatch.cgi failed

Discussion in 'Ruby' started by jlkung@msn.com, Aug 2, 2006.

  1. Guest

    Hi,

    I'm trying to setup RoR on OpenBSD 3.9 with Ruby 1.8.4 and Apache 1.3.
    I've setup Rails to run as a Virtual Host, and I can view the "Welcome
    Aboard" page. When I try to access http://<server>/category/ though, I
    get an "Application error...Rails application failed to start properly"
    message. Apache.log has this error:

    [error] (2)No such file or directory: exec of /todo/public/dispatch.cgi
    failed
    [error] [client 192.168.2.128] Premature end of script headers:
    /todo/public/dispatch.cgi

    The rewrite log has a string of actions ending with:
    192.168.2.128 - - [01/Aug/2006:18:06:21 -0700]
    [todo/sid#8931257c][rid#86bbd034/initial] (4) RewriteCond:
    input='/todo/public/images/rails.png' pattern='!-f' => not-matched
    192.168.2.128 - - [01/Aug/2006:18:06:21 -0700]
    [todo/sid#8931257c][rid#86bbd034/initial] (1) [per-dir /todo/public/]
    pass through /todo/public/images/rails.png

    I have the right path to ruby in .htaccess, have 755 permissions in my
    public directory, and have edited .htaccess to route through
    dispatch.cgi.

    Can anyone help?

    I've pasted my dispatch.cgi and .htaccess files below.

    Thanks in advance,
    Josiah

    ..htaccess
    --------------
    AddHandler fastcgi-script .fcgi
    AddHandler cgi-script .cgi
    Options +FollowSymLinks +ExecCGI

    RewriteEngine On

    RewriteRule ^$ index.html [QSA]
    RewriteRule ^([^.]+)$ $1.html [QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

    ErrorDocument 500 "<h2>Application error</h2>Rails application failed
    to start p
    roperly"

    dispatch.cgi
    -----------------
    #!/usr/local/bin/ruby

    require File.dirname(__FILE__) + "/../config/environment" unless
    defined?(RAILS_ROOT)

    require "dispatcher"
    #require
    "/usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.1.4/lib/action_web_service/dispatcher"

    ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if
    File.directory?(dir) } if defined?(Apache::RubyRun)
    Dispatcher.dispatch
    , Aug 2, 2006
    #1
    1. Advertising

  2. Jan Svitok Guest

    On 8/2/06, <> wrote:
    > Hi,
    >
    > I'm trying to setup RoR on OpenBSD 3.9 with Ruby 1.8.4 and Apache 1.3.
    > I've setup Rails to run as a Virtual Host, and I can view the "Welcome
    > Aboard" page. When I try to access http://<server>/category/ though, I
    > get an "Application error...Rails application failed to start properly"
    > message. Apache.log has this error:
    >
    > [error] (2)No such file or directory: exec of /todo/public/dispatch.cgi
    > failed
    > [error] [client 192.168.2.128] Premature end of script headers:
    > /todo/public/dispatch.cgi
    >
    > The rewrite log has a string of actions ending with:
    > 192.168.2.128 - - [01/Aug/2006:18:06:21 -0700]
    > [todo/sid#8931257c][rid#86bbd034/initial] (4) RewriteCond:
    > input='/todo/public/images/rails.png' pattern='!-f' => not-matched
    > 192.168.2.128 - - [01/Aug/2006:18:06:21 -0700]
    > [todo/sid#8931257c][rid#86bbd034/initial] (1) [per-dir /todo/public/]
    > pass through /todo/public/images/rails.png


    these lines relate to the welcome aboard page.

    Try asking in rails forum, perhaps they'll know better (even though
    there is much overlap between these two, I suppose)

    rubyonrails.com/community

    J.
    Jan Svitok, Aug 2, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lialie
    Replies:
    3
    Views:
    3,619
    Ryan Ginstrom
    Mar 13, 2008
  2. lialie
    Replies:
    0
    Views:
    352
    lialie
    Mar 14, 2008
  3. Marcin Jurczuk

    [rails] dispatch.fcgi do not exiting ..

    Marcin Jurczuk, Nov 2, 2005, in forum: Ruby
    Replies:
    1
    Views:
    181
    Jamis Buck
    Nov 2, 2005
  4. Golo
    Replies:
    0
    Views:
    106
  5. Xeno Campanoli
    Replies:
    1
    Views:
    121
    Xeno Campanoli
    Jul 18, 2008
Loading...

Share This Page