1. Skip to navigation
  2. Skip to content

Streamlined Plugin ArgumentError

If you’re receiving this error when using the streamlined plugin, I might have a solution for you:

“A copy of AuthenticatedSystem has been removed from the module tree but is still active!”

It’s taken me several hours of investigation but I found something that works. The issue is that in Rails 1.2 the order of initialization has changed. You can find a lot more information about this from Rick Olson’s blog.

The issue is that the PlugIns load before the application itself. Therefore the PlugIns cannot refer to the application or monkey patch it.

To correct this problem in streamlined we only need to comment out two lines; the require line to the application.rb file and the line that reminds us not to act_as_streamlined from the ApplicationController directly. The beginning of the module should look like the following:

#require "#{RAILS_ROOT}/app/controllers/application"
module StreamlinedController 
  def self.included(base) 
    #raise "Cannot extend ApplicationController with acts_as_streamlined: please extend individual controllers." if base.instance_of? ApplicationController 
    base.extend(ClassMethods) 
  end

The problem with these lines is that they are referring to the ApplicationController which creates a dependency between streamlined and the ApplicationController. As I understand it prevents its dependencies from being unloadable.

I’ve done some preliminary testing and it appears to be working fine. I will continue with some more thorough testing and report back if there are problems.


Discussion