https://github.com/tmm1/rbtrace
Find Ruby Process
On Unix systems:
$ ps aux
or in Ruby:
> Process.pid
See what’s going on
$ rbtrace -p 12345 --firehose
Trace method
$ rbtrace -p 12345 -m sleep Dir.chdir
Trace all in a class/module
$ rbtrace -p 12345 -m Kernel#
Return backtraces
$ rbtrace -p 12345 --backtraces
IRB session
$ rbtrace -p 12345 --interactive
Use eval
$ rbtrace --pid 12345 -e 'puts Rails.env'