Ruby on rails Rails能够在开发中解析名称空间模型,但不能在临时环境中解析

Ruby on rails Rails能够在开发中解析名称空间模型,但不能在临时环境中解析,ruby-on-rails,ruby,ruby-on-rails-5,Ruby On Rails,Ruby,Ruby On Rails 5,我在登台时遇到以下错误,但在本地工作正常 namererror(未初始化的常量管理器::卖方::产品) 导致/app/services/manager/admins/sellers/products/curation.rb中出现错误的行 module Manager module Admins module Sellers module Products class Curation ... def my_

我在登台时遇到以下错误,但在本地工作正常

namererror(未初始化的常量管理器::卖方::产品)

导致
/app/services/manager/admins/sellers/products/curation.rb中出现错误的行

module Manager
  module Admins
    module Sellers
      module Products
         class Curation
            ...
            def my_function
               @product.update(entity_id: @entity_id,
                               curation_status: Seller::Product.curation_statuses[:accepted])
             end
      ....
当将
添加到上面代码中的
Seller::Product
中,使其成为绝对值时,它会工作,以便从目录顶部解析它

奇怪的是:在我的本地/dev-env上,我没有得到错误

我是否正确地使用了名称间距/常量

  • 是不是因为Rails 5在开发中自动重新加载了
    ,而不是在登台/生产中
  • 我是否缺少config/environments/staging.rb中的设置
型号/卖方/产品.rb

类卖家::产品
型号/seller.rb

classseller

参考文献:

如果您将其放入
应用程序.rb
,它是否有效
config.enable\u dependency\u load=true
Hey@Severin。谢谢你的建议。如果您运行的是Rails 5.2,请注意,在生产环境中,默认情况下会禁用自动加载。这可能是罪魁祸首。
  class Seller::Product < ApplicationRecord
      ...
  end
end
class Seller < ActiveRecord::Base
   ...
end