[Mongrel] Passing environment to mongrel apps

Pete DeLaurentis pete at nextengine.com
Mon Apr 23 20:33:31 EDT 2007


Hi guys,

I'm looking for a way to pass environment variables to my Rails app  
via Mongrel.  I want to conditionally execute code in environment.rb  
based on these environment variables.

Background:

1. I have some special stuff I want to do when my Rails app first starts
2. So, stuff it in environment.rb in after_initialize, right?
3. Not this time.  I have several other background processes that  
include environment.rb, but shouldn't run this code.

Some other background:

I'm using lighttpd, mongrel, and mongrel_cluster

If there's not a way to do this, I can fallback on having all the  
background processes set an environment variable, but this doesn't  
seem as clean.

Thanks for the help!
Pete



More information about the Mongrel-users mailing list