问题
I'm looking for some suggestions on a tool similar to using binding.pry.
I'm serving a rails app locally with foreman and would like to accomplish the same ability to put "debuggers" in my code and when the process hits that, freeze and open a console environment in that section of the code.
I've tried using pry with foreman to no avail and was curious if there are other known tools I'm not finding through google?
Thanks for the suggestions.
回答1:
Try pry-remote, it seems to be the answer of running Pry with Foreman.
Checklist:
- Make sure you're using
binding.remote_pry
instead ofbinding.pry
. - Make sure to run your program making binding.remote_pry first and then run in console
remote-pry
, otherwise the pry server won't be running. - If nothing helps, try adding
require 'pry-remote'
at the top of your.rb
file. - Check also this issue.
来源:https://stackoverflow.com/questions/32671250/is-there-a-reliable-tool-for-stepping-through-code-while-serving-in-foreman