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

  • Home
  • SEARCH
  • 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 6741797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:46:05+00:00 2026-05-26T11:46:05+00:00

I’m adding a mountable engine to my rails app, which provides a forum-like functionality

  • 0

I’m adding a mountable engine to my rails app, which provides a forum-like functionality (i.e. adds questions, answers, comments, etc). Everything works fine in development. In staging/production, however, I get an error when trying to create an answer, specifically a CanCan permission error (though I think that may be a red herring). But it feels like ti might be related to namespacing or name collision?

At any rate, the issue goes away when I set config.cache_classes = false in my environment configuration file. But that’s not an acceptable solution since it really slows things down.

Where do I go from here? How can I figure out which classes needs to be reloaded? What’s the conventional way to deal with this problem?

I’m using Rails 3.1.

  • 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-05-26T11:46:06+00:00Added an answer on May 26, 2026 at 11:46 am

    I figured out the problem. It was an issue with boot order. My Engine::AnswersController was being loaded before my Engine::ApplicationController. And in my code, I was inheriting from just ApplicationController. That means, since Engine::AnswerController didn’t know about Engine::ApplicationController it was erroneously inheriting from the main app’s ApplicationController rather than the engine’s ApplicationController.

    The fix was to force the answers controller to inherit from the engine rather than the main app by making the engine namespace explicit:

    Engine::AnswersController < Engine::ApplicationController
    

    I understand this problem is rather idiosyncratic to my application but how I arrived at the solution might be helpful to others. If you’re faced with this type of problem, drop down into some type of debugger (I used Pry) and start inspecting things. Specifically, check what classes are loaded and look hard at the inheritance chain (i.e. Engine::ApplicationController.ancestors). Look for anything that seems odd.

    Also if the issue is engine related, you might need to place debuggers in both the engine and the main app. Debugging engines can be difficult since errors occurring in the engine might not necessarily bubble up to the main app.

    Much thanks to tjbladez for helping me figure this out.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I have a text area in my form which accepts all possible characters from
I am writing an app with both english and french support. The app requests

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.