# Another NoMethodError

**URL:** <https://www.ruby-forum.com/t/another-nomethoderror/174460>\
**Category:** Rails\
**Created:** [August 26, 2009, 11:42pm UTC](https://www.ruby-forum.com/t/another-nomethoderror/174460 "2009-08-26T23:42:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bobm](https://www.ruby-forum.com/u/bobm)\
**Post date:** [August 26, 2009, 11:42pm UTC](https://www.ruby-forum.com/t/another-nomethoderror/174460/1 "2009-08-26T23:42:55Z")

</div>

I have an ActiveRecord class called Foo that I’ve added some methods  
to in the foo.rb file.  
I have created an instance of Foo within another ActiveRecord Bar  
within the file bar.rb.

I keep getting this error:  
NoMethodError (undefined method `do\_some\_stuff’ for #Foo:0x3d61c14):

I very clearly have a method:

class Foo \< ActiveRecord::Base  
def do\_some\_stuff  
puts “I did some stuff”  
end  
end

Is there something I’m missing that is causing this?  
Do I have to call something to make this method available outside of  
the class?

Thanks, Bob

---

<div class="post-metadata">

**Author:** ![bobm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bobm](https://www.ruby-forum.com/u/bobm)\
**Post date:** [August 27, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/another-nomethoderror/174460/2 "2009-08-27T19:52:18Z")

</div>

The foo you Foo’ed is not the foo you think you Foo’ed…

In other words, you’ll have to show the Bar code that created that  
pseudo-Foo before we can help.

---

<div class="post-metadata">

**Author:** ![bobm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bobm](https://www.ruby-forum.com/u/bobm)\
**Post date:** [August 26, 2009, 11:54pm UTC](https://www.ruby-forum.com/t/another-nomethoderror/174460/3 "2009-08-26T23:54:03Z")

</div>

On Aug 26, 9:36 pm, Bob M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there something I’m missing that is causing this?  
> Do I have to call something to make this method available outside of  
> the class?

nope. What does your actual code look like ?

Fred
