host: <%= Rails.application.secrets[:database][:host]%> database: <%= Rails.application.secrets[:database][:name]%> username: <%= Rails.application.secrets[:database][:username]%> password: <%= Rails.application.secrets[:database][:password]%>
Lord, do not do this. Do not do this for many reasons.
Instead, use ENV vars on the production server:
host: <%= ENV['DB_HOST'] %> database: <%= ENV['DB_NAME'] %> username: <%= ENV['DB_USER'] %> password: <%= ENV['DB_PASSEWORD'] %>
Then you want to go to your prod server and set these variables in the shell configuration file (.bashrc, .zshrc, .profile) as follows:
export DB_HOST=your_host export DB_NAME=your_name export DB_USER=your_user export DB_PASSWORD=your_password
Your problem is 1 out of 2 possible things:
a. A race condition when database configurations are uploaded to a secrets file.
b. You have secrets.yml secrets that are not environments and do not have these nodes for a development / testing environment.
source share