2016-12-06 55 views
-2

我想用postgresql在rails上啓動一個應用程序,但我對這個過程相當陌生並且不熟悉。當我嘗試在localhost:3000上啓動rail服務器時,我遇到密碼錯誤。這是我得到的錯誤。如何在rails上爲ruby設置postgresql database.yml上的用戶名和密碼?

fe_sendauth:沒有密碼提供

# connected server's characteristics. 
    def connect 
     @connection = PGconn.connect(@connection_parameters) <!-- This line says there's an issue --> 
     configure_connection 
    rescue ::PG::Error => error 
     if error.message.include?("does not exist") 

任何人都知道我可以在Windows上設置的用戶名和密碼,或者我需要做什麼來解決這個錯誤是什麼?

+2

的可能的複製[如何設置在Rails的database.yml文件?](http://stackoverflow.com/questions/7304576/how- do-i-set-the-database-yml-file-in-rails) –

回答

0

的config/database.yml的

development: 
    adapter: postgresql 
    encoding: utf8 
    pool: 5 
    username: postgres 
    password: postgres_password 
    database: development_db 

production: 
    adapter: postgresql 
    encoding: utf8 
    pool: 5 
    username: postgres 
    password: postgres_password 
    database: production_db 
+0

這些都不適合我。我不知道爲什麼。 –