4

なんらかの理由でアプリを heroku で起動するのに問題があり、Web サイトにアクセスしようとするとアプリケーション エラーが発生します。次のエラーが発生します。

/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `create_reflection' for #<Class:0x00000002cd3be0>

newrelic gem、バージョンを追加したときに最初に表示され、3.6.0.83に更新しても修正されませんでした3.6.1.87。gem を削除すると問題が解決します。

完全なスタック トレースは次のとおりです。

2013-04-25T20:07:05.103138+00:00 heroku[slugc]: Slug compilation started
2013-04-25T20:08:31.370750+00:00 heroku[api]: Release v30 created by lobatifricha@gmail.com
2013-04-25T20:08:31.416852+00:00 heroku[api]: Deploy cdebc45 by lobatifricha@gmail.com
2013-04-25T20:08:31.967790+00:00 heroku[deployhooks]: Notified New Relic about the deploy
2013-04-25T20:08:32.438963+00:00 heroku[slugc]: Slug compilation finished
2013-04-25T20:08:33.740669+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e $RAILS_ENV -p 21046`
2013-04-25T20:08:31.500921+00:00 heroku[web.1]: State changed from crashed to starting
2013-04-25T20:08:37.882708+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-04-25T20:08:37.882708+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Starting the New Relic agent in "production" environment.
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Reading configuration from config/newrelic.yml
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] WARN : Agent is configured not to use SSL when communicating with New Relic's servers
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Dispatcher: thin
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Environment: production
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : To prevent agent startup add a NEWRELIC_ENABLE=false environment variable or modify the "production" section of your newrelic.yml.
2013-04-25T20:08:40.983660+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing Rails 3.1/3.2 view instrumentation
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Application: quickies
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing Rails 3 Controller instrumentation
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing Net instrumentation
2013-04-25T20:08:40.983322+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing ActiveRecord instrumentation
2013-04-25T20:08:40.987527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/associations/builder/belongs_to.rb:14:in `build'
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:502:in `load_missing_constant'
2013-04-25T20:08:40.987527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/autosave_association.rb:139:in `build'
2013-04-25T20:08:40.987527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-04-25T20:08:40.987527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/associations.rb:1431:in `belongs_to'
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing'
2013-04-25T20:08:40.983660+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Installing Rails3 Error instrumentation
2013-04-25T20:08:40.987527+00:00 app[web.1]:    from /app/app/models/context.rb:1:in `<top (required)>'
2013-04-25T20:08:40.983660+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:40 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Starting Agent shutdown
2013-04-25T20:08:40.987527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `each'
2013-04-25T20:08:40.987527+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `create_reflection' for #<Class:0x00000002cd3be0> (NoMethodError)
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-04-25T20:08:40.983660+00:00 app[web.1]: ** [NewRelic][04/25/13 20:08:39 +0000 8a6f9f69-c49b-417d-b39a-d89256cf9f23 (2)] INFO : Finished instrumentation
2013-04-25T20:08:40.987527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb:12:in `build'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:260:in `safe_constantize'
2013-04-25T20:08:40.987527+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb:25:in `build'
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:230:in `block in constantize'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:359:in `require_or_load'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:190:in `const_missing'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `constantize'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/core_ext/string/inflections.rb:66:in `safe_constantize'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/app/controllers/contexts_controller.rb:1:in `<top (required)>'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:152:in `_default_wrap_model'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:169:in `_set_wrapper_defaults'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-04-25T20:08:40.987527+00:00 app[web.1]:    from /app/app/models/context.rb:6:in `<class:Context>'
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:359:in `require_or_load'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
2013-04-25T20:08:40.988968+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `load'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
2013-04-25T20:08:40.987833+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/inflector/methods.rb:229:in `each'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in `require_dependency'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:438:in `each'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
2013-04-25T20:08:40.988968+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:436:in `each'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from config.ru:1:in `new'
2013-04-25T20:08:40.988073+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:133:in `inherited'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:436:in `eager_load!'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from config.ru:1:in `<main>'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:438:in `block in eager_load!'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `eval'
2013-04-25T20:08:40.988307+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:313:in `depend_on'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from config.ru:3:in `block in <main>'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from /app/config/environment.rb:5:in `<top (required)>'
2013-04-25T20:08:40.988749+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:71:in `start'
2013-04-25T20:08:40.988528+00:00 app[web.1]:    from config.ru:3:in `require'
2013-04-25T20:08:40.988968+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
2013-04-25T20:08:40.988968+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
2013-04-25T20:08:42.284042+00:00 heroku[web.1]: Process exited with status 1
2013-04-25T20:08:42.303661+00:00 heroku[web.1]: State changed from starting to crashed
4

2 に答える 2

4

ニューレリックで働いています。これがかなり古いことは知っていますが、他のユーザーが同じ問題を抱えている場合に備えて返信すると思いました.

表示されているエラーは、Ruby エージェントのバージョン 3.6.4 で修正された問題のインスタンスのようです (この変更ログ エントリを参照してください)。

簡単に言えば、根本的な原因は、アプリケーションが実行されている環境に関するレポートを生成するときに、バックグラウンド スレッドからのロードをトリガーすることによって引き起こされた競合状態でしActiveRecord::Baseた。修正は、メイン スレッドでこのレポートを生成する以前の動作に戻すことでした。 .

于 2013-07-17T04:43:52.533 に答える