相关疑难解决方法(0)

Postgresql"没有pg_hba.conf条目"错误

我正在为rails项目(我正在加入)设置我的本地postgresql数据库,并完成了以下操作:

  • 安装postgres
  • 添加/捆绑'pg'宝石
  • 创建名为"foobar"的db用户
  • 创建了一个名为"foobar_development"的数据库

rails应用程序附带了rake db:migrate任务.当我运行此任务时,我得到以下错误输出:

FATAL:  no pg_hba.conf entry for host "::1", user "foobar", database "foobar_development", SSL off
Run Code Online (Sandbox Code Playgroud)

我在以下位置找到了一个pg_hba.conf文件:

在/ usr /本地的/ var/Postgres的

这是pg_hba.conf文件的相关部分:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.

#local   replication     jimmyli …
Run Code Online (Sandbox Code Playgroud)

database postgresql ruby-on-rails postgresql-9.2

2
推荐指数
1
解决办法
2万
查看次数