嗨,我正在尝试将 postgresql 连接到我的 rails 项目。我正在学习测试,但由于密码不正确的 postgresql 错误,我的测试没有运行:
Edmunds-MacBook-Pro:langexchange edmundmai$ rake test:units
rake aborted!
fe_sendauth: no password supplied
我已经阅读过,我的 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 edmundmai
这是我的 rails 项目中的 database.yml 文件
default: &default
adapter: postgresql
encoding: utf8
pool: 5
username: edmundmai
password:
development:
<<: *default
database: project_development
test:
<<: *default
database: project_test
production:
<<: *default
database: project_production
有谁知道我该如何解决这个问题?如果方便的话,我们可以聊天。