未初始化的常量ActiveRecord :: ConnectionAdapters :: AbstractMysqlAdapter :: MysqlDateTime

时间:2016-10-27 12:44:12

标签: ruby-on-rails ruby ruby-on-rails-4 activerecord

在生产环境中,我收到以下错误

uninitialized constant ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::MysqlDateTime

有人帮我解决了这个问题。我搜索了很多东西,但是我找不到解决这个问题的方法。

  • Ruby版本 - 2.2.0
  • Rails版本 - 4.2.0

错误日志详细信息:

  

ActionView::Template::Error: uninitialized constant ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::MysqlDateTime vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:263:in const_get'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / inflector / methods.rb:263:in block in constantize' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:259:in每个'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / inflector / methods.rb:259:in inject' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/inflector/methods.rb:259:in constantize'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / core_ext / string / inflections.rb:66:in constantize' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/core_ext/marshal.rb:10:in rescue in load_with_autoloading'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / core_ext / marshal.rb:6:in load_with_autoloading' vendor/bundle/ruby/2.2.0/gems/activerecord-session_store-0.1.0/lib/active_record/session_store.rb:11:in unmarshal'   vendor / bundle / ruby​​ / 2.2.0 / gems / activerecord-session_store-0.1.0 / lib / active_record / session_store / session.rb:60:在get_session中的data' vendor/bundle/ruby/2.2.0/gems/activerecord-session_store-0.1.0/lib/action_dispatch/session/active_record_store.rb:72:in块中'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / core_ext / kernel / reporting.rb:120:in block (2 levels) in quietly' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/core_ext/kernel/reporting.rb:54:in silence_stream'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / core_ext / kernel / reporting.rb:119:block in quietly' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/core_ext/kernel/reporting.rb:54:in silence_stream'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / core_ext / kernel / reporting.rb:118:in quietly' vendor/bundle/ruby/2.2.0/gems/activerecord-session_store-0.1.0/lib/action_dispatch/session/active_record_store.rb:64:in get_session'   vendor / bundle / ruby​​ / 2.2.0 / gems / rack-1.6.4 / lib / rack / session / abstract / id.rb:266:在load_session中的load_session' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/session/abstract_store.rb:43:in块中'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / session / abstract_store.rb:51:in stale_session_check!' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/session/abstract_store.rb:43:in load_session'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionpack-4.2.0 / lib / action_dispatch / request / session.rb:180:in load!' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/request/session.rb:172:in load_for_read!'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionpack-4.2.0 / lib / action_dispatch / request / session.rb:89:in []' vendor/bundle/ruby/2.2.0/gems/exception_notification-4.1.4/lib/exception_notifier/views/exception_notifier/_session.text.erb:1:in _ vendor_bundle_ruby _______ gems_exception_notification _______ lib_exception_notifier_views_exception_notifier__session_text_erb ___ 2672557614301542611_69896127503220'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / template.rb:145:in block in render' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:166:in instrument'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / template.rb:333:in instrument' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/template.rb:143:in render'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / renderer / partial_renderer.rb:339:在render_partial' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/renderer/partial_renderer.rb:310:in块中渲染'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / renderer / abstract_renderer.rb:39:在block in instrument' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in块中的仪器'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / notifications / instrumenter.rb:20:in instrument' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in instrument'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / renderer / abstract_renderer.rb:39:in instrument' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/renderer/partial_renderer.rb:309:in render'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / renderer / renderer.rb:47:in render_partial' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/helpers/rendering_helper.rb:35:in render'   vendor / bundle / ruby​​ / 2.2.0 / gems / haml-4.0.7 / lib / haml / helpers / action_view_mods.rb:12:in render_with_haml' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/template.rb:145:in块中的渲染'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / notifications.rb:166:in instrument' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/template.rb:333:in instrument'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / template.rb:143:在render' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/renderer/template_renderer.rb:54:in块(2级)中的render_template'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / renderer / abstract_renderer.rb:39:在block in instrument' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in块中的仪器'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / notifications / instrumenter.rb:20:in instrument' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in instrument'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / renderer / abstract_renderer.rb:39:在render_template中的instrument' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/renderer/template_renderer.rb:53:in块中'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / renderer / template_renderer.rb:61:in render_with_layout' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/renderer/template_renderer.rb:52:in render_template'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / renderer / template_renderer.rb:14:in render' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/renderer/renderer.rb:42:in render_template'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / renderer / renderer.rb:23:in render' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/rendering.rb:100:in _ render_template'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionview-4.2.0 / lib / action_view / rendering.rb:83:in render_to_body' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/rendering.rb:25:in render'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionmailer-4.2.0 / lib / action_mailer / base.rb:887:in block in collect_responses' vendor/bundle/ruby/2.2.0/gems/actionmailer-4.2.0/lib/action_mailer/collector.rb:26:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionmailer-4.2.0 / lib / action_mailer / collector.rb:26:in custom' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/collector.rb:10:in text'   vendor / bundle / ruby​​ / 2.2.0 / gems / exception_notification-4.1.4 / lib / exception_notifier / email_notifier.rb:107:in block in compose_email' vendor/bundle/ruby/2.2.0/gems/actionmailer-4.2.0/lib/action_mailer/base.rb:888:in collect_responses'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionmailer-4.2.0 / lib / action_mailer / base.rb:828:in mail' vendor/bundle/ruby/2.2.0/gems/exception_notification-4.1.4/lib/exception_notifier/email_notifier.rb:106:in compose_email'   vendor / bundle / ruby​​ / 2.2.0 / gems / exception_notification-4.1.4 / lib / exception_notifier / email_notifier.rb:40:in exception_notification' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:198:in process_action'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionpack-4.2.0 / lib / abstract_controller / callbacks.rb:20:in block in process_action' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / callbacks.rb:88:in _run_callbacks' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in _ run_process_action_callbacks'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / callbacks.rb:81:in run_callbacks' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:19:in process_action'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionpack-4.2.0 / lib / abstract_controller / base.rb:137:在process' vendor/bundle/ruby/2.2.0/gems/actionview-4.2.0/lib/action_view/rendering.rb:30:in进程'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionmailer-4.2.0 / lib / action_mailer / base.rb:596:在block in process' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in块中的仪器'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / notifications / instrumenter.rb:20:in instrument' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in instrument'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionmailer-4.2.0 / lib / action_mailer / base.rb:593:process' vendor/bundle/ruby/2.2.0/gems/actionmailer-4.2.0/lib/action_mailer/base.rb:584:in初始化'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionmailer-4.2.0 / lib / action_mailer / message_delivery.rb:25:in new' vendor/bundle/ruby/2.2.0/gems/actionmailer-4.2.0/lib/action_mailer/message_delivery.rb:25:in getobj '   vendor / bundle / ruby​​ / 2.2.0 / gems / actionmailer-4.2.0 / lib / action_mailer / message_delivery.rb:34:in message' vendor/bundle/ruby/2.2.0/gems/actionmailer-4.2.0/lib/action_mailer/message_delivery.rb:85:in deliver_now'   vendor / bundle / ruby​​ / 2.2.0 / gems / exception_notification-4.1.4 / lib / exception_notifier / email_notifier.rb:153:in call' vendor/bundle/ruby/2.2.0/gems/exception_notification-4.1.4/lib/exception_notifier.rb:95:in fire_notification'   vendor / bundle / ruby​​ / 2.2.0 / gems / exception_notification-4.1.4 / lib / exception_notifier.rb:40:block in notify_exception' vendor/bundle/ruby/2.2.0/gems/exception_notification-4.1.4/lib/exception_notifier.rb:39:in每个'   vendor / bundle / ruby​​ / 2.2.0 / gems / exception_notification-4.1.4 / lib / exception_notifier.rb:39:在notify_exception' vendor/bundle/ruby/2.2.0/gems/exception_notification-4.1.4/lib/exception_notification/rack.rb:42:in救援电话'   vendor / bundle / ruby​​ / 2.2.0 / gems / exception_notification-4.1.4 / lib / exception_notification / rack.rb:32:in call' vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/etag.rb:24:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / rack-1.6.4 / lib / rack / conditionalget.rb:38:in call' vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/head.rb:13:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / remotipart-1.2.1 / lib / remotipart / middleware.rb:27:in call' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/params_parser.rb:27:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / flash.rb:260:call' vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in上下文'   vendor / bundle / ruby​​ / 2.2.0 / gems / rack-1.6.4 / lib / rack / session / abstract / id.rb:220:in call' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/cookies.rb:560:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / activerecord-4.2.0 / lib / active_record / query_cache.rb:36:in call' vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / callbacks.rb:29:in block in call' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / callbacks.rb:88:in _run_callbacks' vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in _ run_call_callbacks'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / callbacks.rb:81:in run_callbacks' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / remote_ip.rb:78:in call' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / actionpack-4.2.0 / lib / action_dispatch / middleware / show_exceptions.rb:30:in call' vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in call_app'   vendor / bundle / ruby​​ / 2.2.0 / gems / railties-4.2.0 / lib / rails / rack / logger.rb:22:in call' vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / rack-1.6.4 / lib / rack / methodoverride.rb:22:in call' vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / activesupport-4.2.0 / lib / active_support / cache / strategy / local_cache_middleware.rb:28:in call' vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / utf8-cleaner-0.2.4 / lib / utf8-cleaner / middleware.rb:21:in call' vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:518:in call'   vendor / bundle / ruby​​ / 2.2.0 / gems / railties-4.2.0 / lib / rails / application.rb:164:in call' /usr/local/rvm/gems/ruby-2.2.0/gems/passenger-5.0.6/lib/phusion_passenger/rack/thread_handler_extension.rb:85:in process_request'   /usr/local/rvm/gems/ruby-2.2.0/gems/passenger-5.0.6/lib/phusion_passenger/request_handler/thread_handler.rb:155:in accept_and_process_next_request' /usr/local/rvm/gems/ruby-2.2.0/gems/passenger-5.0.6/lib/phusion_passenger/request_handler/thread_handler.rb:110:in main_loop'   /usr/local/rvm/gems/ruby-2.2.0/gems/passenger-5.0.6/lib/phusion_passenger/request_handler.rb:414:in block (3 levels) in start_threads' /usr/local/rvm/gems/ruby-2.2.0/gems/passenger-5.0.6/lib/phusion_passenger/utils.rb:111:in阻止在create_thread_and_abort_on_exception'   `

0 个答案:

没有答案