# Undefined method \`\*' for nil:NilClass

**URL:** <https://www.ruby-forum.com/t/undefined-method-for-nil-nilclass/196157>\
**Category:** Ruby\
**Created:** [October 7, 2010, 5:10pm UTC](https://www.ruby-forum.com/t/undefined-method-for-nil-nilclass/196157 "2010-10-07T17:10:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![datulravi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c37758/32.png) [@datulravi](https://www.ruby-forum.com/u/datulravi)\
**Post date:** [October 7, 2010, 5:10pm UTC](https://www.ruby-forum.com/t/undefined-method-for-nil-nilclass/196157/1 "2010-10-07T17:10:44Z")

</div>

Please find the .txt file attached. Am getting the following error  
message. Please help!

Error Loading File slab.rb  
undefined method `\*’ for nil:NilClass

---

<div class="post-metadata">

**Author:** ![datulravi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c37758/32.png) [@datulravi](https://www.ruby-forum.com/u/datulravi)\
**Post date:** [October 7, 2010, 10:05pm UTC](https://www.ruby-forum.com/t/undefined-method-for-nil-nilclass/196157/2 "2010-10-07T22:05:34Z")

</div>

Atul D. wrote:

> Please find the .txt file attached. Am getting the following error  
> message. Please help!
> 
> Error Loading File slab.rb  
> undefined method `\*’ for nil:NilClass

You need to give the _full_ error, which includes the line at which the  
error occurred, and the backtrace. Then show what line that line number  
corresponds to.

You’ve posted a large amount of code, but for me it’s not even runnable

- the first line calls a method “file\_loaded?” which on my system (ruby  
1.8.7) doesn’t exist.

So if you cannot boil this down to a five-line standalone test program,  
then you must at least show the exact error and context.

Also, what ruby type and version are you using, and on what platform?

---

<div class="post-metadata">

**Author:** ![datulravi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c37758/32.png) [@datulravi](https://www.ruby-forum.com/u/datulravi)\
**Post date:** [October 8, 2010, 2:14am UTC](https://www.ruby-forum.com/t/undefined-method-for-nil-nilclass/196157/3 "2010-10-08T02:14:44Z")

</div>

Brian C. wrote:

> Atul D. wrote:
> 
> > Please find the .txt file attached. Am getting the following error  
> > message. Please help!
> > 
> > Error Loading File slab.rb  
> > undefined method `\*’ for nil:NilClass
> 
> You need to give the _full_ error, which includes the line at which the  
> error occurred, and the backtrace. Then show what line that line number  
> corresponds to.
> 
> You’ve posted a large amount of code, but for me it’s not even runnable
> 
> - the first line calls a method “file\_loaded?” which on my system (ruby  
> 1.8.7) doesn’t exist.
> 
> So if you cannot boil this down to a five-line standalone test program,  
> then you must at least show the exact error and context.
> 
> Also, what ruby type and version are you using, and on what platform?

Thanks for your reply. Fortunately I somehow managed to debug the error.  
The sad part was there was no mention of the line in which error  
occured! All that was posted is "

> > Error Loading File slab.rb  
> > undefined method `\*’ for nil:NilClass"  
> > I am using Ruby 1.8.6 on Windows 7 (64 bit)by the way…
