Debugger Debugging Ruby?

K

Kevin Kleinfelter

------=_NextPart_000_002F_01C4F829.D1D82ED0
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: 7bit

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


------=_NextPart_000_002F_01C4F829.D1D82ED0--
 
A

Assaph Mehr

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top