I'm getting the mentioned error when deploying a Rails app locally using Phusion Passenger.
My config/database.yml file contains the following:
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: <%= ENV["DB_NAME"] %>
pool: 5
username: <%= ENV["DB_USER"] %>
password: <%= ENV["DB_PASS"] %>
host: <%= ENV["DB_HOST"] %>
The ENV["KEY"] values are stored in secrets.yml, and they're correctly retrieved.