我正在尝试遵循此railscast教程。现在我在这个步骤,你用rake db:create:all创建数据库,但是我收到了这个错误信息:
FATAL: password authentication failed for user aldila
我通过pgAdmin让用户aldila,右键单击登录角色并添加用户aldila密码。
所以,这是我的database.yml:
development:
adapter: postgresql
host: localhost
encoding: unicode
database: my_app_development
pool: 5
username: aldila
password: *mypass*
test:
adapter: postgresql
host: localhost
encoding: unicode
database: my_app_test
pool: 5
username: aldila
password: *mypass*
production:
adapter: postgresql
host: localhost
encoding: unicode
database: my_app_production
pool: 5
username: aldila
password: *mypass*
这是我的pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
也许安装PostreSQL会出现问题,因为如果我打字的话 psql - 我的命令上的转换,这就是我得到的:
'psql' is not recognized as an internal or external command,
operable program or batch file.
但我不知道出了什么问题。我从here安装它,然后从EnterpriseDB下载所有支持版本的安装程序。
我知道已经存在类似的问题,但我会关注this one和this one,但我仍会收到相同的错误消息。如果有人能提供帮助,我将非常感激。感谢
答案 0 :(得分:2)
你的postgresQL密码与你的database.rb密码不符......这取决于你使用的环境..