0

我刚刚将我的应用程序从 SQLite3 切换到 PostgreSQL,当我尝试加载页面http://localhost:3000/或运行 rake db:migrate 时,我得到:

could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

数据库 YAML:

development:
  adapter: postgresql
  database: store_delevopment
  pool: 5

(现在我正在使用默认 Rails 服务器在开发模式下设置服务器。)

4

1 回答 1

1

data/pg_hba.conf在 PostgreSQL文件中将这些条目的方法更改为“信任” :

# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
于 2013-04-24T18:28:58.067 回答