I know a bit of
Java and I have done some debugging here and there using only an
IDE. But, ruby debugging seems quite odd to me.
It looks like there are many ways of debugging ruby code. One way is to insert the following lines before the buggy line in the code you are debugging. This is the
BREAKPOINT IN SOURCE technique
Is this the best way to debug ? It seems so bad to me because I have to insert debugger at all desired breakpoints.
I used it like this - first run the code without debugger, find the line causing error, put the debug code before the line and then run the code again to debug it. Am I doing this correctly ?
Is it better to use Pry debugger instead of this ?