超堆栈部署问题:没有要加载的文件 - models/application_record.rb (LoadError)



我正在使用超堆栈版本1.0.alpha1.4

我的应用程序在开发中运行良好,但是当我尝试在生产模式下部署它时,出现以下错误:

       /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:33:in `require': No such file to load -- models/application_record.rb (LoadError)
        from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
        from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
        from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
        from /app/app/models/application_record.rb:5:in `<top (required)>'
...

我该如何解决这个问题?提前谢谢你。

Hyperstack 在 app/hyperstack/models/下放置一个 application_record.rb 文件使用连续:

class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true
  regulate_scope all: true
end

但还需要在应用/模型下具有以下内容的 application_record.rb:

# app/models/application_record.rb
# the presence of this file prevents rails migrations from recreating application_record.rb
# see https://github.com/rails/rails/issues/29407
require 'models/application_record.rb'

这些文件是否存在?

生产和开发之间的主要区别还在于,在开发过程中,自动加载工作,但在生产中必须预编译资产。你错过了这一步吗?

相关内容

最新更新