我使用 postgres 作为 Rails 的后端数据库,但由于配置错误问题,它已停止工作,但我看不到它是什么。
我的 postgres 版本是 9.1.4,安装在 /usr/bin
我正在运行 ruby 版本 1.9.3,但我必须在 rvm 中手动切换到它,因为会出现默认的 1.8.7。
我正在运行 Rails 3.2.8
我的配置文件 pg_hba.conf 看起来像:
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
postgres.conf 文件中的大多数行都被注释掉了,除了一些无害的行,例如:
log_destination = 'stderr'
listen_addresses = '*'
port = 5432
max_connections = 100
我还为 Mac 安装了“Postgres 应用程序”(请参阅 postgresapp.com/documentation),它说它正在运行并在端口 5432 上侦听。
当我运行 ps -ax | 我看到的 grep 帖子:
1088 ?? 0:00.08 com.heroku.postgres-service
1135 ?? 0:00.29 /Applications/Postgres.app/Contents/MacOS/bin/postgres -D /Users/rickc/Library/Application Support/Postgres/var -p5432
1137 ?? 0:01.14 postgres: writer process
1138 ?? 0:00.78 postgres: wal writer process
1139 ?? 0:00.20 postgres: autovacuum launcher process
1140 ?? 0:00.26 postgres: stats collector process
但是当我尝试在 localhost:3000 启动 rails connect 时,我收到以下错误消息:PG::Error
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
我试图在这里检查以前的帖子,当然,postgres 文档看不到这里配置错误的地方;非常感谢任何帮助...