0

ここに私のスタック情報があります: スタック: 竹-mri-1.9.2

次のコマンドを使用してherokuコンソールにアクセスしようとすると: heroku run -a pakrat script/rails console(pakratは私のアプリ名です)

次のエラーが表示されます: /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1032:in initialize': could not translate host name "ec2-107-22-169-50.compute-1.amazonaws.com" to address: Name or service not known (PGError) from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1032:innew' from /app/.bundle/ gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1032:in connect' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:301:ininitialize' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord- 3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:28: new' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/ の postgresql_connectionでnew_connection' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:323:in/app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:265からのconnection_pool.rb:304:in checkout_new_connection'block (2 levels) in checkout' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:inloop' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:in block in checkout' from /usr/ruby1.9.2/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize' from /app/.bundle/gems /ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:260:in checkout' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:162:inconnection' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord -3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:409:in retrieve_connection' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:107:inretrieve_connection' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters /abstract/connection_specification.rb:89:in connection' from /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/base.rb:703:intable_exists?' /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/base.rb:798:in よりattribute_names' from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/params_wrapper.rb:168:in/app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/params_wrapper.rb:128:ininherited' from /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.1.1/lib/abstract_controller/railties/routes_helpers.rb:7:inブロック (2 レベル) の _set_wrapper_defaults' in with' from /app/ .bundle/gems/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/railties/paths.rb:7:in block (2 levels) in with' from /app/app/controllers/authentications_controller.rb:1:in' from /app/.bundle/gems/ruby/1.9.1/gems/ activesupport-3.1.1/lib/active_support/dependencies.rb:240: require' from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies の「require」のブロック内。 rb:225:in load_dependency' from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:inrequire' from require_or_load' from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:302:in/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:348:independ_on' from /app/.bundle/ gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:214:inrequire_dependency' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:417:ineager_load のブロック (2 レベル)!' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:416:eager_loadeach' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:416:inのブロック内!」from each' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:414:in/app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:414:ineager_load!」from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application/finisher.rb:51:in block in <module:Finisher>' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:ininstance_exec' from /app/.bundle/gems/ruby/1.9 .1/gems/railties-3.1.1/lib/rails/initializable.rb:30: run' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:55:in/app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib の run_initializers のブロック内/rails/initializable.rb:54:in each' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:54:inrun_initializers から /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:96:in initialize!' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:inmethod_missing から / app/config/environment.rb:5:in<top (required)>' from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:inrequire' from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in block in require' from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:inblock in load_dependency' from /app/.bundle/gems/ruby /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/libnew_constants_in' from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:inから /1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in load_dependency に/active_support/dependencies.rb:240:require_environment でrequire' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:83:in!' from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:39:in <top (required)>' from script/rails:6:inrequire' from script/rails:6:in `'

4

1 に答える 1

0

この問題は postgres に接続できないことに関連していると思われるため、ここで述べたように heroku pg:promote を使用してデータベースを昇格させました。

https://devcenter.heroku.com/articles/heroku-postgres-addon

そしてherokuコンソールが再び機能します

于 2012-10-24T04:21:50.107 に答える