Rails and PostgreSQL: Role postgres does not exist

前端 未结 13 2173
一整个雨季
一整个雨季 2020-12-07 07:51

I have installed PostgreSQL on my Mac OS Lion, and am working on a rails app. I use RVM to keep everything separate from my other Rails apps.

For some reason when I

13条回答
  •  日久生厌
    2020-12-07 08:42

    I was on OSX 10.8, and everything I tried would give me the FATAL: role "USER" does not exist. Like many people said here, run createuser -s USER, but that gave me the same error. This finally worked for me:

    $ sudo su
    # su postgres
    # createuser -s --username=postgres MYUSERNAME
    

    The createuser -s --username=postgres creates a superuser (-s flag) by connecting as postgres (--username=postgres flag).

    I see that your question has been answered, but I want to add this answer in for people using OSX trying to install PostgreSQL 9.2.4.

提交回复
热议问题