Best way to debug third-party gems in ruby

前端 未结 5 1467
孤独总比滥情好
孤独总比滥情好 2020-12-07 18:06

Since there may be a lot of Ghost Methods inside a ruby gem, I don\'t think it is a good idea to study the inner mechanism of a ruby gem just by reading

5条回答
  •  [愿得一人]
    2020-12-07 18:14

    If you are using visual studio code, and you have normal debugging enabled for rails you can just open the gem file you want to debug in VS Code, example:

    C:\Ruby26-x64\lib\ruby\gems\2.6.0\gems\devise-4.7.3\app\controllers\devise\registrations_controller.rb
    

    and set a breakpoint with VSCode. It will stop execution on that line.

提交回复
热议问题