OS X rails3 postgresql cannot create database not

2019-09-17 11:00发布

问题:

On a machine running OS X 10.6 a rails 3.2 environment is attempting to create the databases, but failing.

Rake gems tested: include 0.9.2.2 (installed by some dependency) and a declared 10.0.4. username is defined in database.yml

Couldn't create database for {"adapter"=>"postgresql", "database"=>"app_development", "username"=>"postgres"}

FATAL: role "postgres" does not exist

Yet, this is not the first application on the machine. All other applications connect to the postgre cluster with that username. How can this instance not recognize the role and in the others, yes?

回答1:

Just a guess: you installed PG with homebrew, right? If so, the admin user is your own username (type whoami in a terminal), rather than postgres.