In Rails, Couldn't create database for {“adapter”=>“postgresql”,

前端 未结 9 2111
醉话见心
醉话见心 2020-12-14 03:34

I\'m trying to run rake db:create or rake db:setup but I get the following error. It\'s strange because rake db:create it\'s working f

9条回答
  •  死守一世寂寞
    2020-12-14 04:03

    First, you will need to create your user manually in Postgres, while granting privilege of database creation (AKA createdb) for this user.

    To do so, first, open Postgres shell prompt

    $ sudo -u postgres psql

    Create your user

    postgres=# create role Your_DB_username with createdb login password 'YOUR_PASSWORD';

    Exit from Postgres shell

    postgres=# \q

    Do whatever db-related rake task:

    $ rake db:create

    And it will work!

提交回复
热议问题