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 7635111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:21:30+00:00 2026-05-31T07:21:30+00:00

I have a Rails Mountable Engine called Blog. Inside the module, I have a

  • 0

I have a Rails Mountable Engine called Blog.

Inside the module, I have a method called root_path. The module loads the root path of the engine.

module Blog
  def self.root_path
    Engine.routes.url_helpers.root_path
  end
end

Inside one of the javascript assets of the Rails engine, I load the root url of the engine using erb syntax. Like the following line:

url = <%= Blog.root_path %>

When I run, rake assets:precompile, inside my app, I get an error saying the module does not contain such method. Like it isn’t loading the engine library before precompiling the assets.

The error is:

undefined method `root_path' for #< Module:0xc185e14>
  • 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-31T07:21:31+00:00Added an answer on May 31, 2026 at 7:21 am

    Even though Ryan’s answer was helpfull, it wasn’t the reason I was getting the error.

    The reason was that I had set sep up initialize_on_precompile to false in my config/application.rb, so my app wasn’t being started.

    The Rails guides clearly states:

    *For faster asset precompiles, you can partially load your application by setting config.assets.initialize_on_precompile to false in config/application.rb, though in that case templates cannot see application objects or methods*

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

Sidebar

Related Questions

Let's say I have created a mountable engine into ~/my_engine folder: rails plugin new
Using Rails 3.2.2 and Ruby 1.9.2. I have a rails mountable engine EngineA that
i have rails method to sort the blogs based on their votes (acts_as_votable). The
I have Rails 3.1.2 app with a hierarchical relationship that looks like this: Categories
I have rails 3.1.3 and formtastic 2.0.2. I'm using the most basic form you
I have rails app which has a list of users. I have different relations
I have Rails polymorphic model and I want to apply different validations according to
I have rails Rails 2.3.8 and Devise 1.0.8. I have followed the installation instructions
I've created a simple mountable application in rails 3.1.3 using command: $ rails plugin
I have Rails 3.1, Unicorn and Apache setup. My Apache settings are below and

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.