2016-12-06 60 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

这些都不适合我。我不知道为什么。 –