Jim N. wrote:
Robert Br wrote:
Both the #! (shebang) line and the config/database.yml file are correct.
My app is working, but I also get that error. I think you always get
that error when runing the dispatch.fcgi from the command line, but if
you get errors that libraries are not found, then you have a different
problem.
I discovered this as well. But, I tried running it on the command line
again, setting environment variables as described in
http://docs.rinet.ru:8080/CP7/ch13.htm . My reply is continued below.
Is there a way to get a more detailed trace of what dispatch.fcgi is
doing? Is there a better way to debug this problem?
I have also wished for this.
As others have said, try deleting your /tmp/ruby_sess* files, and
restarting the httpd.
Which fcgi method are you using, and what do your relevant config files
and your dispatch.fcgi look like?
Below are the configuration I added to httpd.conf (“rails.conf”),
fastcgi.conf (in the /etc/httpd/conf.d directory), dispatch.fcgi, and
.htaccess . Also below is the output from running dispatch.fcgi on
command line after setting:
REQUEST_METHOD=GET
QUERY_STRING=‘/rails/performers/list?keywords=rolling+stones’
I’m not sure if these environment variables are accurate or not – I
don’t know what actually is passed to dispatch.fcgi via the .htaccess
file (via “dispatch.fcgi?$1”). I also tried running dispatch.cgi and
the results are identical.
Thanks for any further help.
----------------------------------rails.conf----------------------------------
#Alias /rails/ “/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/html/”
Alias /rails/ “/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/public/”
<Directory “/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/public/”>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
---------------------------------fastcgi.conf---------------------------------
LoadModule fastcgi_module modules/mod_fastcgi.so
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
--------------------------------dispatch.fcgi---------------------------------
#!/usr/bin/ruby
require File.dirname(FILE) + “/…/config/environment”
require ‘fcgi_handler’
RailsFCGIHandler.process!
--------------------------------.htaccess-------------------------------------
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 /performers
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/app/views/performers
RewriteBase /performers
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.rhtml [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /dispatch.fcgi?$1 [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 “
Application error
Rails application failed to
start properly”
-------------------------------dispatch.fcgi.out-------------------------------
Content-Type: text/html
Set-Cookie: _session_id=ee5040fdcaaa7ea5fb8ac35b22c2fb65; path=/
Status: 500 Internal Error
Cache-Control: no-cache
Action Controller: Exception caught
body { background-color: #fff; color: #333; }
body, p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
NoMethodError in
<controller not set>#<action not set>
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.<<
RAILS_ROOT: public/../config/..
<a href="#"
onclick=“document.getElementById(‘Framework-Trace’).style.display=‘none’;document.getElementById(‘Full-Trace’).style.display=‘none’;document.getElementById(‘Application-Trace’).style.display=‘block’;;
return false;”>Application Trace |
<a href="#"
onclick=“document.getElementById(‘Application-Trace’).style.display=‘none’;document.getElementById(‘Full-Trace’).style.display=‘none’;document.getElementById(‘Framework-Trace’).style.display=‘block’;;
return false;”>Framework Trace |
<a href="#"
onclick=“document.getElementById(‘Application-Trace’).style.display=‘none’;document.getElementById(‘Framework-Trace’).style.display=‘none’;document.getElementById(‘Full-Trace’).style.display=‘block’;;
return false;”>Full Trace
<div id="Application-Trace" style="display: block;">
<pre><code>/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/request.rb:143:in
request_uri' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/request.rb:161:in
path’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:453:in
recognize!' ./public/../config/../lib/dispatcher.rb:38:in
dispatch’
./public/…/config/…/lib/fcgi_handler.rb:141:in process_request' ./public/../config/../lib/fcgi_handler.rb:53:in
process!’
./public/…/config/…/lib/fcgi_handler.rb:52:in each_cgi' ./public/../config/../lib/fcgi_handler.rb:52:in
process!’
./public/…/config/…/lib/fcgi_handler.rb:22:in process!'</code></pre> </div> <div id="Framework-Trace" style="display: none;"> <pre><code>/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/request.rb:143:in
request_uri’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/request.rb:161:in
path' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:453:in
recognize!’
./public/…/config/…/lib/dispatcher.rb:38:in dispatch' ./public/dispatch.fcgi:24</code></pre> </div> <div id="Full-Trace" style="display: none;"> <pre><code>/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/request.rb:143:in
request_uri’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/request.rb:161:in
path' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:453:in
recognize!’
./public/…/config/…/lib/dispatcher.rb:38:in dispatch' ./public/../config/../lib/fcgi_handler.rb:141:in
process_request’
./public/…/config/…/lib/fcgi_handler.rb:53:in process!' ./public/../config/../lib/fcgi_handler.rb:52:in
each_cgi’
./public/…/config/…/lib/fcgi_handler.rb:52:in process!' ./public/../config/../lib/fcgi_handler.rb:22:in
process!’
./public/dispatch.fcgi:24
Request
Parameters:
{"/rails/performers/list?keywords"=>"rolling
stones"}
Show session dump
Response
Headers: {"cookie"=>[],
"Cache-Control"=>"no-cache"}
-------------------------------------------------------------------------------