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 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