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

476 views Asked by At

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?

0

There are 0 answers