small medium large xlarge

14 Jun 2016, 11:37
laksakan (1 post)

Going through the book, I’m not sure why I am getting this error of the code, from which I am following the book.

The code is displayed below:

iMadeThisToPointToA3 = 3 puts iMadeThisToPointToA3 self.puts iMadeThisToPointToA3

calc.rb:3:in <main>': private method puts’ called for main:Object (NoMethodError)

14 Jun 2016, 20:09
Chris Pine (72 posts)

Are those on three different lines? Because they are supposed to be on three different lines. :-)

If so, the problem is probably a version mismatch: you have an older copy of the book but are using a newer version of Ruby. self.puts is no longer allowed.

Don’t worry about it. :-) Just use puts and it will work fine.

You must be logged in to comment