create a basic Ruby script called debugtest.rb:
i = 1 j = 0 until i > 1000000 i *= 2 j += 1 end puts "i = #{i}, j = #{j}" # run as following # ruby -r debug debugtest.rb