0

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 Answer 1

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.

2
  • Bravo! can someone upvote the chap, as I don't have the privilege to do so. If my memory serves me right, PG was installed with homebrew. Still I remain confused. Any reason why the other applications in the meantime managed to take off with the default username? Or - if my memory is failing me and homebrew was brought in later - is it necessarily the case that homebrew made, at some point changed the admin? But those other apps are booting up with the default username. There's something inconsistent here...
    – Jerome
    Jun 6, 2013 at 12:47
  • It's inconsistent, but there's a notice when you install PG using homebrew. It's not their best idea, it's easily overlooked, and it's easy to forget, but it's documented... Personally, I manually create the postgres user within PG to avoid needing to remember. :-) Jun 6, 2013 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.