Postgres No permission to create user

前端 未结 2 786
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 04:16

I am unable to use rails with postgres. The database wont create:

sayth@sayth-TravelMate-5740G:~/testapp2$ rake db:create:all
PG::InsufficientPrivilege: ERROR:           


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-06 04:50

    Add this using during gitlab_ci DB setup. I solve the problem as described by @Audrius Meškauskas on Ubuntu 12.04:

    Connect as Admin

    sudo -u postgres psql -d template1
    

    Alter role

    ALTER ROLE gitlab_ci WITH CREATEDB;
    

    Re-run the task

    sudo -u gitlab_ci -H bundle exec rake db:setup RAILS_ENV=production
    

提交回复
热议问题