Is there a reliable tool for stepping through code while serving in foreman

◇◆丶佛笑我妖孽 提交于 2019-12-23 23:05:47

问题


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:

  1. Make sure you're using binding.remote_pry instead of binding.pry.
  2. 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.
  3. If nothing helps, try adding require 'pry-remote' at the top of your .rb file.
  4. Check also this issue.


来源:https://stackoverflow.com/questions/32671250/is-there-a-reliable-tool-for-stepping-through-code-while-serving-in-foreman

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!