I also got this error after some recent changes in my Rails application. At first the error appeared in unicorn logs, so I tried to run rake db:setup and got an error there.
In my case, I somehow got the extra space located before the test database definition. So my database.yml looked like this:
... test: adapter: postgresql ... production: adapter: postgresql ...
instead of this:
... test: adapter: postgresql ... production: adapter: postgresql ...
I deleted the space and fixed the problem.
source share