Fixing a 'Connecting to database specified by database.yml' Loop

Occasionally an app is re-deployed but won't start. You open the log and you see 'Connecting to database specified by database.yml' being outputted. Here's how to fix that.