Ok, this post is a bit older, but I ran into the same problem and I was able to solve it. The main thing here: "I didn’t do anything particularly interesting when it started appearing - just moving some code between the helper and the model."
I'm sure you used “include something” in your model ... Make sure it looks like this:
class ClassName include WhatEver::Base
and not:
include WhatEver::Base class ClassName
Rails will download and require files for you in a certain way. In dev / test env, it will continue to reload files, however, during production, the class can be loaded into memory without reloading the file, so your included module will be there when it is loaded first, but not later.
source share