Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

An error in a deep dive lesson "Modules: Extend and Include Part 1"? (Ruby Foundations)

Is that an error in this video (see on a screenshot)?

(the image is a little bit large, so open in a new tab in your browser)

If I dont specify attr_reader I gen an exception as follow:

``hello.rb:10:insay_hello': undefined local variable or method name' for #<Hello:0x8df827c @name="Kirill"> (NameError) from hello.rb:18:in<main>'

My ruby version:
```$ ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [i686-linux]```

1 Answer

Ouch. My bad, I didn't use an instance variable in my module code. How extend behaves is explained in the next video that clarifies why I made a mistake.

Resolved.