[Mongrel] first request always fails

Zed Shaw zedshaw at zedshaw.com
Sun Sep 3 11:28:47 EDT 2006

On Sun, 2006-09-03 at 16:34 +0200, Jeroen Houben wrote:
> Zed Shaw wrote:
> > On Sun, 2006-09-03 at 16:12 +0200, Jeroen Houben wrote:

> Aha. Could this also be the cause of my other problem where my custom 
> ENV['site'] value does not get picked up by environment.rb?
> http://www.ruby-forum.com/topic/79765#133114
> ENV['site'] *is* available in my views, controllers etc but doing:
> RAILS_DEFAULT_LOGGER.warn("ENV: #{ENV.inspect}")
> in environment.rb shows no sign of ENV['site']

Nope, the only reference to ENV in mongrel is in rails.rb where I set it
for production.  Otherwise, that's a Ruby constant so you'd see big
complaints if I messed with that (or anyone did).

But, why are you using ENV?  You could just use any constant you want in
environment.rb.  Try making a SITE_CONFIG = {'site' => 'stuff.com'} and
see if that works instead.

In truth, getting site config values from ENV is kind of a no-no since
you can't trust ENV.  It's the reason a lot of programs clear ENV before
starting other programs.

Zed A. Shaw
http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.

More information about the Mongrel-users mailing list