[Mongrel] first request always fails

Jeroen Houben jeroen at supercool.nl
Sun Sep 3 12:25:28 EDT 2006

Zed Shaw wrote:
> 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.

Interesting. I can't help to feel this is a bit hackish too. But if it 
works it works I suppose..

So I'm guessing you need individual mongrel_cluster.yml files for each 
site and then fire up the mongrel_cluster with -C switch.

I'll give that a go later tonight.



More information about the Mongrel-users mailing list