Why I use Rails model concerns will get the superclass mismatch errors with class in production environment?

青春壹個敷衍的年華 提交于 2019-12-12 01:23:23

问题


I use Puma and Rails 4.2.

My concern is set up like this:

Class Order
  module Chartable
     ...
  end
end

The order class is set up like this:

Class Order
  include Chartable
end

In development, the code showed no errors, but in the production I got the error:

Unable to load application: TypeError: superclass mismatch for class Order.

I don't know why this error happens, and after consulting some documentation, I think the error comes from Puma's set :puma_preload_app, true - is it right?

How can I fix this error and preload_app always set to true?

来源:https://stackoverflow.com/questions/30795339/why-i-use-rails-model-concerns-will-get-the-superclass-mismatch-errors-with-clas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!