From: RichardOnRails Date: 2008-01-04T13:59:59+09:00 Subject: Re: Ruby-Debugger newbie problem On Jan 3, 10:07 am, RichardOnRails wrote: > Hi All, > > Following is a Command window session trying to run Ruby Debugger on a > trivial program. The debugger seems to be stuck in "ubygems.rb" in my > Ruby installation rather than in my test program. Is my installation > messed up? > > I'm running ruby 1.8.2 (2004-12-25) [i386-mswin32] on WinXP/SP2. > > Thanks in Advance, > Richard > > K:\_Projects\Ruby\_Ruby_Tests\TestDebugging>type TestDebugging101.rb > # TestDebugging101.rb > # K:\_Projects\Ruby\_Ruby_Tests\TestDebugging > p 'Line 3' > p 'Line 4' > > K:\_Projects\Ruby\_Ruby_Tests\TestDebugging>ruby -rdebug > TestDebugging101.rb > Debug.rb > Emacs support available. > > K:/_Utilities/Ruby_1.8.2-15/ruby/lib/ruby/site_ruby/1.8/ubygems.rb: > 10:require 'rubygems' > (rdb:1) l > [5, 14] in K:/_Utilities/Ruby_1.8.2-15/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' > (rdb:1) OK, I see that I stopped at ubygems.rb:10 Question 1: Why did the debugger stop there and not continue with statements 3& 4 in my test program? Is my Ruby installation messed up? Q 2: Why do I have a "upygems.rb" in my installation that has nothing substantive than "require 'rubygems'"? Q 3. Does the presence of this strangely named file "upygems.rb" suggest my Ruby installation is messed up? I continued the processing from the current point as shown below. Q 4. Since I put a breakpoint at "upygems.rb:3", why didn't the debugger stop there instead of running through the entire remainder of the test program? Thanks again in advance for any insights you may offer. Regards, Richard (rdb:1) b K:/_Projects/Ruby_Tests/TestDebugging/TestDebugging101.rb:3 Set breakpoint 2 at K:/_Projects/Ruby_Tests/TestDebugging/ TestDebugging101.rb:3 (rdb:1) b Breakpoints: 2 K:/_Projects/Ruby_Tests/TestDebugging/TestDebugging101.rb:3 (rdb:1) c "Line 3" "Line 4" K:\_Projects\Ruby\_Ruby_Tests\TestDebugging>