# Error with plugin module tree

**URL:** <https://www.ruby-forum.com/t/error-with-plugin-module-tree/88126>\
**Category:** Rails\
**Created:** [March 8, 2007, 11:45am UTC](https://www.ruby-forum.com/t/error-with-plugin-module-tree/88126 "2007-03-08T11:45:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adammontgomery](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Post date:** [March 8, 2007, 11:45am UTC](https://www.ruby-forum.com/t/error-with-plugin-module-tree/88126/1 "2007-03-08T11:45:07Z")

</div>

Hello,  
I have created a cut down version of technoweenie’s acts\_as\_attachment  
for a project im working on. It has worked fine but now with what  
appears to be a change to edge rails (did piston update on vendor/rails  
this morning) it fails with the following error. I need the later  
versions of edge rails for some active resource functions.

* * *

Error:  
A copy of Default::ImageBox::ActMethods has been removed from the module  
tree but is still active!

I have attempted to fix with an addition to environment.rb

* * *

config.load\_once\_paths

Here is my code for loading the plugin and the actsmethod.

* * *

Init.rb  
begin  
require ‘image\_science’  
rescue LoadError

# image\_science not found

end  
ActiveRecord::Base.send(:extend, Default::ImageBox::ActMethods)

* * *

default/imagebox/image\_box.rb

module Default # :nodoc:  
module ImageBox # :nodoc:

```
module ActMethods
  def image_box(options = {})
    #set defaults
    options[:thumbnails] ||= []
    options[:storage_location] ||= File.join('assets', 'images')

    # only need to define these once on a class
    unless included_modules.include? InstanceMethods
      class_inheritable_accessor :box_options

      validates_presence_of :source

      before_save :store_data
      after_save :box_images
      after_destroy :destroy_box

      include InstanceMethods
      include FileSystemMethods
    end

    self.box_options = options
  end
end

```

end  
end

---

<div class="post-metadata">

**Author:** ![adammontgomery](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@adammontgomery](https://www.ruby-forum.com/u/adammontgomery)\
**Post date:** [March 8, 2007, 11:46am UTC](https://www.ruby-forum.com/t/error-with-plugin-module-tree/88126/2 "2007-03-08T11:46:57Z")

</div>

I’ve realised that my commend on the piston update is misleading.

I have had the problem for a few weeks. The update i performed this  
morning was a lazy hope its been fixed attempt.
