Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Ruby have a stepwise debugger, similar to Perl's "perl -d"?

Tags:

ruby

debugging

Does Ruby have a stepwise debugger, similar to Perl's "perl -d"?

like image 439
someguy Avatar asked Nov 03 '08 17:11

someguy


2 Answers

The ruby-debug (for ruby 1.8), debugger (for ruby 1.9), byebug (for ruby 2.0) and also the trepanning series all have an -x or --trace option. Inside the debuggers, the command set linetrace will turn on or off line tracing. Here is the manual for ruby-debug

The original answer has been revised because the link to the datanoise article, alas, no longer works. Also added are the successors to ruby-debug

like image 150
jcoby Avatar answered Sep 22 '22 19:09

jcoby


From the command line (if you have the debug module available):

ruby -r debug /path/to/ruby_script.rb
like image 40
Kevin Avatar answered Sep 25 '22 19:09

Kevin