Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   Can't set up rails: dispatch.cgi failed (http://www.velocityreviews.com/forums/t831997-cant-set-up-rails-dispatch-cgi-failed.html)

jlkung@msn.com 08-02-2006 08:19 AM

Can't set up rails: dispatch.cgi failed
 
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


Jan Svitok 08-02-2006 12:59 PM

Re: Can't set up rails: dispatch.cgi failed
 
On 8/2/06, jlkung@msn.com <jlkung@msn.com> 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.



All times are GMT. The time now is 04:32 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.