Can't get into production mode!

Hi all,

I’m deploying my first rails app. I’m using lighty and fcgi, and cannot
get the app to go into production mode. I deploy via Capistrano.

When I dump ENV, RAILS_ENV is still ‘development’. Is something
overriding the lighty config?

Here is the lighty config:

var.appname = “mcalogin”
server.port = 1411
server.modules = (“mod_rewrite”, “mod_fastcgi”, “mod_accesslog”)
server.username = “wwwrun”
server.groupname = “www”
server.pid-file = “/var/run/lighttpd.pid”
accesslog.filename = “/var/log/lighttpd/access_log”
server.errorlog = “/var/log/lighttpd/error_log”
server.indexfiles = ( “index.html” )
url.rewrite = ( “^/$” => “index.html”, “^([^.]+)$” => “$1.html” )
server.error-handler-404 = “/dispatch.fcgi”

server.document-root = “/usr/local/rails/” + var.appname +
“/current/public”

mimetype.assign = (
“.css” => “text/css”,
“.gif” => “image/gif”,
“.html” => “text/html”,
“.htm” => “text/html”,
“.jpeg” => “image/jpeg”,
“.jpg” => “image/jpeg”,
“.js” => “text/javascript”,
“.pdf” => “application/pdf”,
“.png” => “image/png”,
“.txt” => “text/plain”,
“.ppt” => “application/powerpoint”
)

fastcgi.server = ( “.fcgi” =>
( “localhost” =>
( “min-procs” => 1,
“max-procs” => 3,
“socket” => “/tmp/” + var.appname + “fcgi.socket”,
“bin-path” => “/usr/local/rails/” + var.appname +
“/current/public/dispatch.fcgi”,
“bin-environment” => ( “RAILS_ENV” => “production” )
)
)
)

$HTTP[“url”] =~ “.pdf$” { server.range-requests = “disable” }
$HTTP[“url”] =~ “.ppt$” { server.range-requests = “disable” }

Here is the view I built:

  • RAILS_ROOT is <%= h RAILS_ROOT %>
  • expanded path is <%= h File.expand_path(RAILS_ROOT) %>
  • Mode is <%= h ENV['RAILS_ENV'] %>

Here is what I get from the server:

* RAILS_ROOT is

/usr/local/rails/mcalogin/current/public/…/config/…
* expanded path is /usr/local/rails/mcalogin/current
* Mode is development

I thought all I had to do is set RAILS_ENV to ‘production’ in the lighty
config, and rails would be in production mode. Perhaps I am mistaken?

Thanks for any advice you can offer!

Regards,
Rich