# Observers not working because of AR Plugins? (Rails = 1.2.3)

**URL:** <https://www.ruby-forum.com/t/observers-not-working-because-of-ar-plugins-rails-1-2-3/103816>\
**Category:** Rails\
**Created:** [May 10, 2007, 4:43pm UTC](https://www.ruby-forum.com/t/observers-not-working-because-of-ar-plugins-rails-1-2-3/103816 "2007-05-10T16:43:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixellover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pixellover](https://www.ruby-forum.com/u/pixellover)\
**Post date:** [May 10, 2007, 4:43pm UTC](https://www.ruby-forum.com/t/observers-not-working-because-of-ar-plugins-rails-1-2-3/103816/1 "2007-05-10T16:43:30Z")

</div>

Hi list,

I’ve tried to implement a simple Observer to log changes to my objects.  
Whenever I try to enable the observer in my environment.rb, my  
application  
refuses to start.

Here’s what’s in my environment.rb:

Rails::Initializer.run do |config|  
config.active\_record.observers = :audit\_observer  
end

It seems, that rails can’t find the plugins used in the observed models.  
This  
was a problem in older rails version (see  
[http://dev.rubyonrails.org/changeset/4684](http://dev.rubyonrails.org/changeset/4684)), but I’m using rails 1.2.3,  
so  
this is already included.

As nearly all my models ar using some plugins, what can I do to get  
observers  
working?

Here’s the mongrel output:

=\> Booting Mongrel (use ‘script/server webrick’ to force WEBrick)  
=\> Rails application starting on [http://0.0.0.0:3005](http://0.0.0.0:3005)  
=\> Call with -d to detach  
=\> Ctrl-C to shutdown server  
\*\* Starting Mongrel listening at 0.0.0.0:3005  
\*\* Starting Rails with development environment…  
Exiting  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active\_record/base.rb:1235:in  
`method_missing': undefined method `acts\_as\_timeable’ for Client:Class  
(NoMethodError)  
from ./script/…/config/…/app/models/client.rb:3

from  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:203:in  
`load\_file’

from  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:342:in  
`new\_constants\_in’

from  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:202:in  
`load\_file’

from  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:94:in  
`require\_or\_load\_without\_engine\_additions’

from  
./script/…/config/…/vendor/plugins/engines/lib/engines/rails\_extensions/dependencies.rb:139:in  
`require\_or\_load’

from  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:248:in  
`load\_missing\_constant’

from  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:452:in  
`const\_missing’  
… 38 levels…

from  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:495:in  
`require' from /usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’  
from script/server:3

Regards,  
Timo

---

<div class="post-metadata">

**Author:** ![pixellover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pixellover](https://www.ruby-forum.com/u/pixellover)\
**Post date:** [May 10, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/observers-not-working-because-of-ar-plugins-rails-1-2-3/103816/2 "2007-05-10T17:01:35Z")

</div>

ok, I was looking into the wrong version of environment.rb.

It looks like this:

Rails::Initializer.run do |config|  
config.plugins = [“engines”, “\*”]  
config.active\_record.observers = :audit\_observer  
end

I really wonder, why config.plugins = [“engines”, “\*”] is causing the  
error?  
Shouldn’t all plugins get loaded before the observer gets activated?

When I put all plugins into that config.plugins Array, it seems to work.  
So,  
why does “\*” does not work?

Regards,  
Timo
