但是,當我轉到本地主機時,我可以使用postgres.app在Mac上使用postgres.app在應用程序內部沒有任何問題地輸入rails s: 3000它給了我這個錯誤:PG :: ConnectionBad FATAL:角色「myapp」不存在
PG::ConnectionBad
FATAL: role "myapp" does not exist
我起初以爲問題是database.yml文件,但Heroku的文檔,甚至說有它的方式是:https://devcenter.heroku.com/articles/getting-started-with-rails4
development:
adapter: postgresql
encoding: unicode
database: myapp_development
pool: 5
username: myapp
password:
這裏是我的完整的日誌。我見過類似的問題,但他們只是模糊地涉及到這一點。
片段:
Started GET "/" for 127.0.0.1 at 2014-03-25 16:48:31 -0600
PG::ConnectionBad (FATAL: role "myapp" does not exist
):
activerecord (4.0.2) lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `initialize'
activerecord (4.0.2) lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `new'
activerecord (4.0.2) lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `connect'
activerecord (4.0.2) lib/active_record/connection_adapters/postgresql_adapter.rb:548:in `initialize'
activerecord (4.0.2) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
activerecord (4.0.2) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in
有什麼建議?
的可能的複製[PG :: ConnectionBad FATAL:角色 「的Myname」 不存在( http://stackoverflow.com/questions/23338356/pgconnectionbad-fatal-role-myname-does-not-exist) – Meekohi