[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Debugger Debugging Ruby?

Kevin Kleinfelter

1/12/2005 3:07:00 AM

When I run
ruby -rdebug foo.rb
the debugger displays
Debug.rb
Emacs support available.

c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:require 'rubygems'

This would be OK if the first line of foo.rb were "require 'rubygems'", but it isn't. The only line in foo.rb is
print "hello"

Why is the debugger stopping in ubygems.rb? How can I make it stop at the first line in *my* code when it starts?

TIA
Kevin Kleinfelter

1 Answer

Assaph Mehr

1/12/2005 3:55:00 AM

0

You probably have RUBYOPT environment variable set to load rubygems
automatically (it is set up automatically with the 1-click installer).

You can set a breakpoint in the first line of your file as the first
command to the debugger and then continue until you reach it:

c:\TEMP>ruby -rdebug foo.rb
Debug.rb
Emacs support available.

c:/bin/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:require 'rubygems'
(rdb:1) b foo.rb:1
Set breakpoint 1 at foo.rb:1
(rdb:1) c
Breakpoint 1, toplevel at foo.rb:1
foo.rb:1:print "hello"
(rdb:1)


HTH,
Assaph