phusion passenger not seeing environment variables?

nginx, passenger, ruby-on-rails, ubuntu

Solution

Passenger fusion v4+ enables reading of environment variables directly from bashrc file. Make sure that bashrc lives in the home folder of the user under which passenger process is executed (in my case, it was ubuntu, for ec2 linux and nginx)

Here is the documentation which goes into details of bashrc

Problem

We are running ubuntu servers with Nginx + Phusion Passenger for our rails 3.0x apps. I have an environment variable set in /etc/environment on the test machines: ``` MC_TEST=true ``` If I run a console (bundle exec rails c) and output ENV["MC_TEST"] I see 'true'. But, if I put that same code on a page ( <%= ENV["MC_TEST"] %> ) it doesn't see anything. That variable does not exist. Which leads me to question: 1 - What is the proper way to get environment variables into passenger with nginx (not apache SetEnv)? 2 - Why does Passenger not have a proper environment?

Original source