Pry
Pry tricks

binding.pry in external code

Simply monkey patch the method that you are interested in debugging:
1
def SomeGem::method
2
require 'pry'
3
binding.pry
4
super
5
end
Copied!
You can even do this automatically for a list of methods you are interested in:
1
[:foo, :bar, :baz].each do |cb|
2
define_method cb do
3
require 'pry'
4
binding.pry
5
super
6
end
7
end
Copied!

Get filtered stack trace

1
# at breakpoint
2
caller.select {|line| line.starts_with? '/your-app-dir' }
Copied!