• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ruby debugging methods - why add debugger code to my code?

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic