The Rails app I''m working on requires an environment variable to be set. I thought I could do this in my cap deploy script. Unfortunately, it seems that the Mongrel processes that are started up by Mongrel Cluster have their own environments and any environment variables set in the deploy script aren''t passed on. I was able to verify this by having my deploy script run a rake task that outputs the value of of the environment variable I need -- the value is what I''d expect. I then set the Rails app to add that same environment variable in a log message, and it shows that the value is nil. Does anyone have any suggestions for setting an environment variable? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20080602/47d4a032/attachment.html>
Never mind; turns out this is a capistrano issue (running mongrel via sudo). Thanks! On Mon, Jun 2, 2008 at 10:46 PM, jenny w <veganjenny at gmail.com> wrote:> The Rails app I''m working on requires an environment variable to be set. I > thought I could do this in my cap deploy script. Unfortunately, it seems > that the Mongrel processes that are started up by Mongrel Cluster have their > own environments and any environment variables set in the deploy script > aren''t passed on. I was able to verify this by having my deploy script run a > rake task that outputs the value of of the environment variable I need -- > the value is what I''d expect. I then set the Rails app to add that same > environment variable in a log message, and it shows that the value is nil. > Does anyone have any suggestions for setting an environment variable? > > Thanks! >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20080602/c5b6ce98/attachment-0001.html>
Jenny, Environment variables can be defined in the /etc/init.d/ mongrel_cluster script. Bill Siggelkow On Jun 2, 2008, at 10:46 PM, jenny w wrote:> The Rails app I''m working on requires an environment variable to be > set. I thought I could do this in my cap deploy script. > Unfortunately, it seems that the Mongrel processes that are started > up by Mongrel Cluster have their own environments and any > environment variables set in the deploy script aren''t passed on. I > was able to verify this by having my deploy script run a rake task > that outputs the value of of the environment variable I need -- the > value is what I''d expect. I then set the Rails app to add that same > environment variable in a log message, and it shows that the value > is nil. > > Does anyone have any suggestions for setting an environment variable? > > Thanks! > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mongrel-users/attachments/20080603/db8f7613/attachment.html>