2013-05-06 81 views
2

我试图按照这个railscast教程。现在,我在一步,在那里你创建耙DB数据库:创建:所有的,但我得到这个错误信息: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. 

但我没有ide出了什么问题。我从here安装它并从所有支持的版本中选择从EnterpriseDB下载安装程序。

我知道这里已经有类似的问题,但我按照this onethis one,但我仍然收到相同的错误消息。我会非常感激,如果有人可以帮助。由于

+0

是否使用'devise'你的PostgreSQL的密码不匹配您的database.rb密码..它取决于你使用的是什么环境..?也许你忘了添加'password_confirmation'。 – cortex 2013-05-06 15:14:25

+0

不,我不知道。你的意思是为数据库创建登录角色吗?我使用pgAdmin并通过pgAdmin添加登录角色,如果这就是你的意思。 – ishwr 2013-05-06 15:16:39

+0

你在使用什么操作系统? – Sean 2013-05-06 19:05:45

回答

2