Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8651275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:01:28+00:00 2026-06-12T14:01:28+00:00

My situation is a follows: I’m running application X X uses the gem core

  • 0

My situation is a follows:

  • I’m running application X
  • X uses the gem “core”
  • core extends the models of X with models A, B, C, D

In development this works perfectly. However when I run

(bundle exec) rake RAILS_ENV=staging RAILS_GROUPS=assets assets:precompile

it fails on

** Execute environment
rake aborted!
uninitialized constant A

I tried to fix this issue by placing Rails.application.eager_load! before the Application.initialize! in environments.rb, but I’m afraid that only led to other errors.

Is there a way to include models from an engine in a gem BEFORE the assets:precompile?
I read something about requiring them one by one instead of eager_load all, but the path to the gem differs for every system.

engine.rb in “core”:

require 'paperclip'

module Core
  class Engine < ::Rails::Engine

    config.time_zone = 'Amsterdam'
    config.encoding = "utf-8"
    config.autoload_paths += %W(#{config.root}/lib/**)

    config.generators do |g|
      g.test_framework :rspec, :views => false, :fixture => true
      g.fixture_replacement :factory_girl, :dir => 'spec/factories'
    end

    initializer "core.load_app_instance_data" do |app|
      Core.setup do |config|
        config.app_root = app.root
      end
      app.class.configure do 
        #Pull in all the migrations from Commons to the application
        config.paths['db/migrate'] += Core::Engine.paths['db/migrate'].existent
      end
    end

    initializer "core.load_static_assets" do |app|
      app.middleware.use ::ActionDispatch::Static, "#{root}/public"
    end    
  end
end

I prefer to put any fix in the core gem instead of application X. However if it’s not possible X is fine 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:01:30+00:00Added an answer on June 12, 2026 at 2:01 pm

    Are you sure the “core” gem is loaded in the staging environment?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

situation is as follows - client uses smart card authetication against server (F5 server
I am using jquery selectable plugin and running it to a situation as follows.
The situation is as follows: I have an internal server running some WCF services,
Our situation is as follows, but I'm curious about this problem in any situation.
The situation is as follows: I've got 2 models: 'Action' and 'User'. These models
I have a situation as follows <body> Test<br /> test<br /> test1<br /> </body>
My situation is as follows: I'm working on an implementation of BlackJack. I've got
Here is my situation, I have a string as follows 'a':1 'b':2 'c':3 I
Picture the following situation. I have an XML document as follows, <Form> <Control Type=Text
Situation: 1. Linux TCP server 2 Windows C# client application The server receives messages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.