betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

13 June 2014

Getting into the Ruby Debugger

The missing fin

I was trying to debug a ruby script yesterday, so I searched the docs and the web for how to do this. Part one of the problem: various older versions had different ways to do this, having to install some gem or not, etc. Ruby 2.1 has something built in, so there I was. Put this in your code:

require "debug"

Simple enough (in Python it's "import pdb; pdb.set_trace()"). But then I got stuck, because the debugger was somewhere in the debugging code, not in my code. No mention of that in the docs or in the tutorials I'd found.

The solution was to step up from the current frame, with the debugger command:

fin

which is short for fin[ish] - return to outer frame. The h command gives all the help you need - as long as you are used to command line debuggers like Python's pdb. But that fin thing had me searching and wondering for a while.


Posted by betabug at 13:36 | Comments (2) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< The site is coming back | Main | Danakos Climbing Gym >>
Comments
Re: Getting into the Ruby Debugger

I had been looking for a ruby equivalent of python's pdb and this is exactly that! Thank you!!

Posted by: Aaron Briel at April 02,2015 14:51
Re: Getting into the Ruby Debugger

Hi Aaron! Glad this was helpfull!

Posted by: betabug at April 08,2015 14:23
Trackbacks
You can trackback to: http://betabug.ch/blogs/ch-athens/1347/tbping
There are no trackbacks.
Leave a comment