Forum: Ruby on Rails Re: Recognition failed for "/dispatch.cgi"

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Natevw (Guest)
on 2006-04-29 03:06
(Received via mailing list)
The problem turned out to be fairly simple. The main problem: Apache
handles the ScriptAlias directories so that all files are "executed"
rather than served. I'm assuming also that Apache doesn't bother looking
at the .htaccess files therein, either.

So instead, I had 'rails' put everything into my web document area. The
path issue seems to be resolved without any of my help - I'm assuming
for now that it was automatically configured during the rails install.
Now it works quite nicely, and I can get back to my term paper!

So, if anyone else runs stuck similarly, the moral is: don't try to save
on configuration time by putting everything straight into /cgi-bin/! So
long as .htaccess files are enabled, anywhere whithin DocumentRoot is a
right place.


Natevw wrote:
 > Changed subject to reflect new developments.
 > I can run the script/server just fine, "Riding the Rails" shows up on
 >, but still nothing via my host's Apache2.
 > At least part of the problem must be with paths. I have ruby
 > in ~/devtemp/bin. However, most of the scripts reference
 > ruby" when the path is set to some basic default.
 > I tried SetEnv PATH /home/natevw/devtemp/bin in the
 > railstest/public/.htaccess, and tried setting ENV['PATH'] ||=
 > in an environment.rb file. Still no luck!
 > How do I set the CGI's path correctly so that Ruby sees it?
 > Googling and forum searching, I'm not finding many others installing
 > Rails into a hosted account on someone else's server. Surely this is
 > the case...?
 > -natevw
 > Natevw wrote:
 >> Alright, I got ruby, rubygem and perhaps rails installed on my
 >> I am able to run a plain Ruby script from my cgi-bin.
 >> I can create a whole mess of folders and files by typing "rails
 >> testrails" in my cgi-bin.
 >> But after that, I can't get the wonderful behavior described in all
 >> the tutorials.
 >> Going to '/cgi-bin/testrails/public/' gets 404'ed.
 >> When I go to /cgi-bin/testrails/public/index.html, I get the 500
 >> defined in the .htaccess file: "Rails application failed to start
 >> properly"
 >> Running ./dispatch.cgi straight from the shell leaves the following
 >> development.log:
 >> Recognition failed for ""

 >> `recognition_failed'

 >> `recognize!'

 >> `dispatch'
 >> ./dispatch.cgi:10
 >> What am I missing?
 >> thanks,
 >> -natevw
This topic is locked and can not be replied to.