Generic-user-small Wes Rishel 1 post

The first time I tried to use the debugger was in 186 and I am seeing something different than in v2 of the book on page 163. Or perhaps I am doing something wrong.

In the book it appears that when you run with the debugger option, such as this

ruby.exe -r debug t.rb

you end up with the debugger looking at the source file (e.g., t.rb).

However, when I run it I end up in some Ruby module:

ruby.exe -r debug t.rb
C:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10:require ‘rubygems’
(rdb:1) l
[5, 14] in C:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb 5 # All rights reserved. 6 # See LICENSE.txt for permissions. 7 #++ 8 9
=> 10 require ‘rubygems’

The work-around seems pretty simple: set a breakpoint in your own file and type C, as below.

I thought you might want to know, in order to update the book.

(rdb:1) b t.rb:3
Set breakpoint 1 at t.rb:3
(rdb:1) c
Breakpoint 1, toplevel at t.rb:3

1 post, 1 voice