Best way to debug third-party gems in ruby

前端 未结 5 1470
孤独总比滥情好
孤独总比滥情好 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:19

    I would avoid editing the Gem files as suggested in the currently accepted answer. Instead, put the debugger command in one of your app files and use the break command to set a breakpoint in the gem. I'm using rvm with a gemset so here is how I do it:

    break /Users/chris/.rvm/gems/ruby-1.9.3-p125@/gems/-/:

提交回复
热议问题