#8 ✓resolved
Bruce Perens

rough start for new user: misplaced require statement, class reloading

Reported by Bruce Perens | May 1st, 2008 @ 09:26 AM

In installing engines, I found these problems:

1. The default rails environment included a commented-out require statment for the engines boot file, which I enabled. This is above the line where the rails environment is required. So its effect is that script/server works, but mongrel_rails start does not. If the line is still that way in edge rails, a bug should be submitted for it.

2. I put a controller in my engine, and the second and subsequent uses of that controller caused the message "ArgumentError (A copy of ApplicationController has been removed from the module tree but is still active!)". I added this to the rails initialization, after reading previous emails:

  1. Kludge to fix engines.

config.after_initialize { Dependencies.load_once_paths = [] }

As far as I can tell, any use of a controller in the engine would set this off, since all of them include ApplicationController, and that will be reloaded. Can the engines plugin tweak the load_once_paths, so that the user doesn't have to?

Comments and changes to this ticket

  • Bruce Perens

    Bruce Perens May 1st, 2008 @ 09:29 AM

    Of course the "1." before "Kludge" in the above report should be a pound sign, the markup munged it for me.

  • James Adam

    James Adam May 1st, 2008 @ 09:44 PM

    • Assigned user set to “James Adam”

    I've just tried generating a blank Rails application, and it doesn't (by default) include any statements about the engines plugin itself (as far as I can see). Requiring engines' boot file is something that must be added manually.

    Can you confirm that the line was there without any manual intervention?

  • James Adam

    James Adam May 1st, 2008 @ 09:49 PM

    For your reloading issue - is it a version of ApplicationController that you have in your plugin?

    Could you try replicating the problem within the test_app that the engines plugin generates? Clone the plugin from github, then run "rake RAILS=edge" to generate a new application against the latest Rails, then make your changes in the test_app directory.


  • James Adam

    James Adam October 24th, 2008 @ 02:01 AM

    • State changed from “new” to “resolved”

    Closing this - no feedback given.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The rails engines plugin itself

Shared Ticket Bins

People watching this ticket