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

前端 未结 9 2101
醉话见心
醉话见心 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:15

    Also check you don't have an open connection such as a client or an application connected to the instance. If that happen you will see this in the error

    Couldn't create database for {"adapter"=>"xxxx", "database"=>"xxxx", "host"=>"localhost", "username"=>"postgres", "password"=>"xxxxx", "pool"=>5, "timeout"=>5000}
    rake aborted!
    ActiveRecord::StatementInvalid: PG::ObjectInUse: ERROR:  source database "template1" is being accessed by other users
    DETAIL:  There is 1 other session using the database.
    

提交回复
热议问题