Hyperstack deployment problem: No such file to load -- models/application_record.rb (LoadError)

139 Views Asked by At

I am using hyperstack version 1.0.alpha1.4

My app works fine in development, but when I try to deploy it in production mode, I get the following error:

       /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)>'
...

How can I solve this? Thank you in advance.

1

There are 1 best solutions below

1
On

Hyperstack places an application_record.rb file under app/hyperstack/models/ with contnets:

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

but also requires an application_record.rb under app/models with the following contents:

# 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'

do these files exist?

also the main difference between production and development is that during development auto loading work but in production assets must be precompiled. did you miss this step?