Debugging in Ruby

gem install ruby-debug

1. Add your breakpoint in your source code.

require ‘ruby-debug’

debugger

2. Now you can test in irb

my_buggy_method(‘foo’)

 

3. And use standard debugging commands:

Continue to breakpoint: c

Next Line (Step Over): n

Step Into: s

Note: interact with environment – 

irb

http://pivotallabs.com/users/chad/blog/articles/366-ruby-debug-in-30-seconds-we-don-t-need-no-stinkin-gui-

See also this gem:

gem install cheat

http://cheat.errtheblog.com

Leave a Reply

Your email address will not be published. Required fields are marked *