[Mongrel] first request always fails

Zed Shaw zedshaw at zedshaw.com
Sun Sep 3 11:54:39 EDT 2006


On Sun, 2006-09-03 at 17:45 +0200, Jeroen Houben wrote:
> Zed Shaw wrote:
> > 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.
> 
> The reason I'm using it is because I'm running multiple sites from one 
> rails app. I'm trying to pass some sort of variable to each mongrel upon 
> startup  to indicate which subdomain (and thus which client) each 
> mongrel belongs to. I'm sure there is a better and DRYer way to so this, 
> but I haven't found it yet.

Ok, why not an environment for each site?  Just like production.rb or
development.rb, but demo.rb, mysite.rb.  Then, you just pass in -e
demo.rb.

People do this quite frequently, only catch is to make sure that you
haven't relied on the environment setting for other stuff, but even that
you could change to "production" manually inside the demo.rb.


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



More information about the Mongrel-users mailing list