我正在尝试遵循这个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 --version ,这就是我得到的:
'psql' is not recognized as an internal or external command,
operable program or batch file.
但我不知道出了什么问题。我从这里安装它并选择从 EnterpriseDB 下载所有支持版本的安装程序。