Sublime text can't understand gets.chomp
I wrote this simple program in ruby using Sublime Text and for some reason if I build it using Sublime text inbuilt system then I get the following error `deposit': undefined method `chomp' for nil:NilClass (NoMethodError) Its running perfectly if I run it using cmd. class BankAccount def initialize(name) @transactions = [] @balance = 0 end def deposit print "How much do you want to deposit?" amount = gets.chomp @balance += amount.to_f puts "$#{amount} is deposited" end def show_balance puts "Your balance is #{@balance}" end end bank_account = BankAccount.new("Rohit Begani") bank_account.class