# Script in lib that uses active records fails with \`method\_missing': undefined local variable or met

**URL:** <https://www.ruby-forum.com/t/script-in-lib-that-uses-active-records-fails-with-method-missing-undefined-local-variable-or-met/120403>\
**Category:** Rails\
**Created:** [November 16, 2007, 4:07pm UTC](https://www.ruby-forum.com/t/script-in-lib-that-uses-active-records-fails-with-method-missing-undefined-local-variable-or-met/120403 "2007-11-16T16:07:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Obelix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e68b1a/32.png) [@Obelix](https://www.ruby-forum.com/u/Obelix)\
**Post date:** [November 16, 2007, 4:07pm UTC](https://www.ruby-forum.com/t/script-in-lib-that-uses-active-records-fails-with-method-missing-undefined-local-variable-or-met/120403/1 "2007-11-16T16:07:33Z")

</div>

I have written a simple script in the lib directory that accesses an  
active record that ‘acts\_as\_taggable’

I get this error when I run the script.

/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/  
active\_record/base.rb:1238:in `method_missing': undefined local variable or method`acts\_as\_taggable’ for Entity:Class (NameError)

For some reason, nothing in vendor/plugins is in the load path.  
Adding the specific directories to $: doesn’t help either.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![Obelix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e68b1a/32.png) [@Obelix](https://www.ruby-forum.com/u/Obelix)\
**Post date:** [November 16, 2007, 4:25pm UTC](https://www.ruby-forum.com/t/script-in-lib-that-uses-active-records-fails-with-method-missing-undefined-local-variable-or-met/120403/2 "2007-11-16T16:25:02Z")

</div>

did u restart the server?

---

<div class="post-metadata">

**Author:** ![Obelix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/e68b1a/32.png) [@Obelix](https://www.ruby-forum.com/u/Obelix)\
**Post date:** [November 16, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/script-in-lib-that-uses-active-records-fails-with-method-missing-undefined-local-variable-or-met/120403/3 "2007-11-16T16:34:31Z")

</div>

Yes, I did, just tried again as well.

On Nov 16, 2007 7:25 AM, Thorsten M.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ## did u restart the server?
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
anand

Photo gallery: [http://www.anands.net](http://www.anands.net)  
Photo blog: [http://blog.anands.net](http://blog.anands.net)  
Text blog: [http://textblog.anands.net](http://textblog.anands.net)
