require 'debuglog' and record debugging information (including variable traces and timing information) to the file debug.log -- cheap and easy.
>= 1.8.6
Gavin Sinclair