2013-05-06 72 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

相關問題