I keep getting a Recognition failed for "/dispatch.fcgi" error. I search for a solution and the closest I came to finding one was someone saying "look at the Rewrite in .htaccess and you''ll be able to figure it out." Well, I can''t! If anyone could help, I would appreciate it. Thanks! Floyd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060513/ca1536e5/attachment.html
What does your .htaccess look like? Maybe we can start there. Also, I assume you''re running Apache. Provide some more details. Michael
Michael, You assume correctly. I am running Apache 1.3 on Mac OS X 10.4 Server. Here''s my .htaccess file. It''s the default on that ruby creates. # General Apache options AddHandler fastcgi-script .fcgi AddHandler cgi-script .cgi Options +FollowSymLinks +ExecCGI # If you don''t want Rails to look in certain directories, # use the following rewrite rules so that Apache won''t rewrite certain requests # # Example: # RewriteCond %{REQUEST_URI} ^/notrails.* # RewriteRule .* - [L] # Redirect all requests not available on the filesystem to Rails # By default the cgi dispatcher is used which is very slow # # For better performance replace the dispatcher with the fastcgi one # # Example: # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] RewriteEngine On # If your Rails application is accessed via an Alias directive, # then you MUST also set the RewriteBase in this htaccess file. # # Example: # Alias /myrailsapp /path/to/myrailsapp/public # RewriteBase /myrailsapp RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.cgi [QSA,L] # In case Rails experiences terminal errors # Instead of displaying this message you can supply a file here which will be rendered instead # # Example: # ErrorDocument 500 /500.html ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly" Thanks! Floyd On May 13, 2006, at 10:14 AM, Michael Trier wrote:> What does your .htaccess look like? Maybe we can start there. Also, > I assume you''re running Apache. Provide some more details. > > Michael > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Any progress on this? Are you running fastcgi or fcgid, or are you just trying to use mod_ruby? Generally I''ll get the 500 error when the permissions aren''t right on the log and tmp directories. The web server needs to be able to write into both of these. Michael
The tmp and log directories are world writable. I looked in the development.log file and saw this towards the end: ActionController::RoutingError (Recognition failed for "/ dispatch.fcgi"): /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ action_controller/routing.rb:488:in `recognition_failed'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ action_controller/routing.rb:478:in `recognize!'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb: 38:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ fcgi_handler.rb:150:in `process_request'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ fcgi_handler.rb:54:in `process!'' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi'' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ fcgi_handler.rb:53:in `process!'' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ fcgi_handler.rb:23:in `process!'' /Users/macmage/Sites/maccrafters/guestbook/public/dispatch.fcgi:24 In the fastcgi.log file, I saw this: [13/May/2006:20:07:58 :: 28217] asked to terminate immediately [13/May/2006:20:07:58 :: 28217] terminated by explicit exit Did you happen to notice anything amiss in my .htaccess file I provided in my previous email? Thanks for the help, Floyd On May 15, 2006, at 7:44 AM, Michael Trier wrote:> Any progress on this? Are you running fastcgi or fcgid, or are you > just trying to use mod_ruby? Generally I''ll get the 500 error when > the permissions aren''t right on the log and tmp directories. The web > server needs to be able to write into both of these. > > Michael > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Change this line: RewriteRule ^(.*)$ dispatch.cgi [QSA,L] to RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] Everyone forgets that one. You also don''t need both handlers at the top. Just the fcgi one. Michael On 5/15/06, Floyd Resler <macmage@maccrafters.com> wrote:> The tmp and log directories are world writable. I looked in the > development.log file and saw this towards the end: > ActionController::RoutingError (Recognition failed for "/ > dispatch.fcgi"): > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ > action_controller/routing.rb:488:in `recognition_failed'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ > action_controller/routing.rb:478:in `recognize!'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb: > 38:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ > fcgi_handler.rb:150:in `process_request'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ > fcgi_handler.rb:54:in `process!'' > /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi'' > /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ > fcgi_handler.rb:53:in `process!'' > /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ > fcgi_handler.rb:23:in `process!'' > /Users/macmage/Sites/maccrafters/guestbook/public/dispatch.fcgi:24 > > In the fastcgi.log file, I saw this: > [13/May/2006:20:07:58 :: 28217] asked to terminate immediately > [13/May/2006:20:07:58 :: 28217] terminated by explicit exit > > Did you happen to notice anything amiss in my .htaccess file I > provided in my previous email? > > Thanks for the help, > Floyd > > > On May 15, 2006, at 7:44 AM, Michael Trier wrote: > > > Any progress on this? Are you running fastcgi or fcgid, or are you > > just trying to use mod_ruby? Generally I''ll get the 500 error when > > the permissions aren''t right on the log and tmp directories. The web > > server needs to be able to write into both of these. > > > > Michael > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Thanks, but I had already changed the rewrite rule and still no go. I took out the additional handler and it still doesn''t work. I''m sure it''s something simple I''m missing. I''m just not sure what! Thanks! Floyd On May 15, 2006, at 4:50 PM, Michael Trier wrote:> Change this line: > > RewriteRule ^(.*)$ dispatch.cgi [QSA,L] > > to > > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > Everyone forgets that one. You also don''t need both handlers at the > top. Just the fcgi one. > > Michael > > On 5/15/06, Floyd Resler <macmage@maccrafters.com> wrote: >> The tmp and log directories are world writable. I looked in the >> development.log file and saw this towards the end: >> ActionController::RoutingError (Recognition failed for "/ >> dispatch.fcgi"): >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ >> action_controller/routing.rb:488:in `recognition_failed'' >> /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ >> action_controller/routing.rb:478:in `recognize!'' >> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb: >> 38:in `dispatch'' >> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ >> fcgi_handler.rb:150:in `process_request'' >> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ >> fcgi_handler.rb:54:in `process!'' >> /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi'' >> /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' >> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ >> fcgi_handler.rb:53:in `process!'' >> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ >> fcgi_handler.rb:23:in `process!'' >> /Users/macmage/Sites/maccrafters/guestbook/public/ >> dispatch.fcgi:24 >> >> In the fastcgi.log file, I saw this: >> [13/May/2006:20:07:58 :: 28217] asked to terminate immediately >> [13/May/2006:20:07:58 :: 28217] terminated by explicit exit >> >> Did you happen to notice anything amiss in my .htaccess file I >> provided in my previous email? >> >> Thanks for the help, >> Floyd >> >> >> On May 15, 2006, at 7:44 AM, Michael Trier wrote: >> >> > Any progress on this? Are you running fastcgi or fcgid, or are you >> > just trying to use mod_ruby? Generally I''ll get the 500 error when >> > the permissions aren''t right on the log and tmp directories. >> The web >> > server needs to be able to write into both of these. >> > >> > Michael >> > _______________________________________________ >> > Rails mailing list >> > Rails@lists.rubyonrails.org >> > http://lists.rubyonrails.org/mailman/listinfo/rails >> > >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I got it figured out. It was the RewriteBase line. When I uncommented it and changed the path, everything worked fine. Floyd On May 15, 2006, at 5:45 PM, Floyd Resler wrote:> Thanks, but I had already changed the rewrite rule and still no > go. I took out the additional handler and it still doesn''t work. > I''m sure it''s something simple I''m missing. I''m just not sure what! > > Thanks! > > Floyd > > On May 15, 2006, at 4:50 PM, Michael Trier wrote: > >> Change this line: >> >> RewriteRule ^(.*)$ dispatch.cgi [QSA,L] >> >> to >> >> RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] >> >> Everyone forgets that one. You also don''t need both handlers at the >> top. Just the fcgi one. >> >> Michael >> >> On 5/15/06, Floyd Resler <macmage@maccrafters.com> wrote: >>> The tmp and log directories are world writable. I looked in the >>> development.log file and saw this towards the end: >>> ActionController::RoutingError (Recognition failed for "/ >>> dispatch.fcgi"): >>> /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ >>> action_controller/routing.rb:488:in `recognition_failed'' >>> /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ >>> action_controller/routing.rb:478:in `recognize!'' >>> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ >>> dispatcher.rb: >>> 38:in `dispatch'' >>> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ >>> fcgi_handler.rb:150:in `process_request'' >>> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ >>> fcgi_handler.rb:54:in `process!'' >>> /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi'' >>> /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' >>> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ >>> fcgi_handler.rb:53:in `process!'' >>> /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/ >>> fcgi_handler.rb:23:in `process!'' >>> /Users/macmage/Sites/maccrafters/guestbook/public/ >>> dispatch.fcgi:24 >>> >>> In the fastcgi.log file, I saw this: >>> [13/May/2006:20:07:58 :: 28217] asked to terminate immediately >>> [13/May/2006:20:07:58 :: 28217] terminated by explicit exit >>> >>> Did you happen to notice anything amiss in my .htaccess file I >>> provided in my previous email? >>> >>> Thanks for the help, >>> Floyd >>> >>> >>> On May 15, 2006, at 7:44 AM, Michael Trier wrote: >>> >>> > Any progress on this? Are you running fastcgi or fcgid, or are >>> you >>> > just trying to use mod_ruby? Generally I''ll get the 500 error >>> when >>> > the permissions aren''t right on the log and tmp directories. >>> The web >>> > server needs to be able to write into both of these. >>> > >>> > Michael >>> > _______________________________________________ >>> > Rails mailing list >>> > Rails@lists.rubyonrails.org >>> > http://lists.rubyonrails.org/mailman/listinfo/rails >>> > >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails@lists.rubyonrails.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >