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 Ruby Foundations Numbers Math

Error in irb with Math.log

Hello fellow learners!

If I follow the instructions in the course and type in the following in irb:

>>Math.log(12, 3)

I receive the following error:

ArgumentError: wrong number of arguments (2 for 1)

But I do not understand why. Am I missing something?

Thank you in advance!

Cheers, Matthew

2 Answers

Patrick Metcalfe
PLUS
Patrick Metcalfe
Courses Plus Student 7,563 Points

What version of ruby are you using. I'm not aware of any version that would cause this problem but it might help hunt down the problem.

Hi Patrick, thank you for offering to help me hunt down the problem! I just started up irb on my mac terminal and wanted to reproduce the error, but for some reason i did not receive any error message this time. Since answering the question I most likely updated my ruby installation via homebrew. Non the less quite weird, since I remember basically copy-pasting what i had input in the terminal into this forum, when i originally asked this question and being able to reproduce the error a month ago. Anyway, it seems to have taken care of itself. :-)

Cheers, naano