Question: Passenger Ignoring RAILS_ENV

Passenger Ignoring RAILS_ENV

I've got an env file with various variables depended upon by my Rails app, including RAILS_ENV, which is initialized to development in this file. I've also got database.yml file defining DB connections for my environments (below). When I run the rails console, everything looks as it should. Checking Rails.configuration.database_configuration[Rails.env] returns the following:

/etc/sysconfig/httpd: I've tried manually sourcing the file directly from Apache config and verified by dumping env to file when the script runs that the correct values are making it into the env, however this too does not change the broken behavior.

I would generally recommend you avoid specifying DB user names and passwords in database.yml. Use the ENV vars Luke! While you are halfway there its better to stick to a convention over configuration approach rather than introducing seperate vars.

A litmus test for whether an app has all config correctly factored out
of the code is whether the codebase could be made open source at any
moment, without compromising any credentials.
https://12factor.net/config