第一次尝试设置 postgresql 数据库。我正在使用这个railscast。经过几个小时令人沮丧的问题,我得到了 rake db:create:all。现在我得到错误:
password authentication failed for user "pgtest"
这是我的 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
这是我的 database.yml
development:
adapter: postgresql
encoding: unicode
database: pgtest_development
pool: 5
username: pgtest
password: password
test:
adapter: postgresql
encoding: unicode
database: pgtest_test
pool: 5
username: pgtest
password: password
我先尝试了没有密码,它给出了错误:
fe_sendauth: no password supplied
我究竟做错了什么?谢谢 :)