您好我目前正在迈克尔哈特尔教程的第6章。
在我设法将它送到heroku之后,bundle exec rake db:migrate
无法正常工作并且它一直给我以下错误。
我已经尝试将几个用户名和密码添加到database.yml文件中,但无济于事。
任何人都可以对此有所了解吗?
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
rake aborted!
PG::Error: FATAL: password authentication failed for user "amuudiqbgwhemy"
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/postgresql_adapter.rb:881:in `initialize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/postgresql_adapter.rb:881:in `new'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/postgresql_adapter.rb:881:in `connect'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/postgresql_adapter.rb:568:in `initialize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/postgresql_adapter.rb:41:in `new'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection
'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:435:in `new_connection
'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:445:in `checkout_new_c
onnection'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:416:in `acquire_connec
tion'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:351:in `block in check
out'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:350:in `checkout'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:265:in `block in conne
ction'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_conne
ction'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_handling.rb:113:in `retrieve_connection'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/connection_handling.rb:87:in `connection'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/migration.rb:910:in `initialize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/migration.rb:807:in `new'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/migration.rb:807:in `up'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/migration.rb:785:in `migrate'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.1/lib/acti
ve_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:240:in `call'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:240:in `block in execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:235:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:235:in `execute'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:179:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:172:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:165:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:150:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:106:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:106:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:106:in `block in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:115:in `run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:100:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:78:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:176:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:75:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/bin/rake:33:in
`<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate
答案 0 :(得分:0)
在您将应用推送到heroku之后,您应该尝试运行(从您的本地终端)
heroku run rake db:migrate
在上下文中,您不必在database.yml文件中设置用户名/密码,因为您正在使用的Postgres数据库是通过使用postgres附加组件设置的配置变量来设置的。