From: "Jesús Gabriel y Galán" Date: 2012-10-09T16:57:31+09:00 Subject: Re: Undefined method `-' for nil On Mon, Oct 8, 2012 at 11:22 PM, Joz Private wrote: > def moves_loans > amount_of_loans = amount_of_loans - amount > end Here amount_of_loans is understoos as a local variable, since you have an assigment, so the amount_of_loans at the right hand side gets evaluated to nil. I guess you want the instance variable, so: def moves_loans @amount_of_loans = @amount_of_loans - amount end or def moves_loans @amount_of_loans -= amount end Jesus.