Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Ruby Foundations Methods Instance Methods

Stuart Santos
Stuart Santos
13,557 Points

IRB load error

I followed the video exactly and then went in to irb and typed in load ./bank_account.rb and it keeps giving me the following error:

ArgumentError: wrong number of arguments (0 for 1..2) from (irb):1:in load' from (irb):1 from /Users/stuartsantos/.rbenv/versions/2.1.2/bin/irb:11:in<main>'

The code in my .rb file is as follows:

class BankAccount
    def initialize(first_name, last_name)
        @balance = 0
        @first_name = first_name
        @last_name = last_name
    end

    def deposit(amount)
        @balance += amount
    end

    def withdraw(amount)
        @balance -= amount
    end

end

1 Answer

Stuart Santos
Stuart Santos
13,557 Points

It was my bad, didn't notice that the path load uses needs to be wrapped in quotation marks