Hi,
I am trying to deploy a trivial rails application on an apache server,
using the, as I understand obsolete, CGI way.
First of all, some versions:
System: Debian 5.0
Apache: Apache 2.2.9
Ruby: 1.8.7
Gem: 1.3.1 (manually installed, downloaded from rubyonrails.org)
Installed gems:
actionmailer (2.3.2)
actionpack (2.3.2)
activerecord (2.3.2)
activeresource (2.3.2)
activesupport (2.3.2)
rails (2.3.2)
rake (0.8.4)
Contents of the .htaccess file in my rails app’s public directory:
(A cluster of howtos seems to agree that this is what it’s content
should be.)
Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi
SetEnv RAILS_ENV production
RewriteEngine on
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
This is how I created my rails application (according to:
Ruby on Rails 2.3 Release Notes — Ruby on Rails Guides):
rails railstest --with-dispatchers
My problem is, it won’t work. I get the following error:
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/cgi_process.rb:22:in
__send__': You have a nil object when you didn't expect it! (NoMethodError) The error occurred while evaluating nil.env_table from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/cgi_process.rb:22:in
dispatch_cgi’
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:102:in
dispatch_cgi' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:28:in
dispatch’
from ./dispatch.cgi:10
I can’t find anything in particular about that problem, can you help me?