How to use the debugger with Ruby 2.0?

前端 未结 3 1360
天命终不由人
天命终不由人 2020-12-05 17:27

I know the debugger gem is not and never will be compatible with ruby 2.0 per "officially support ruby 2.X".

In the changelog of Ruby 2.0 is:

相关标签:
3条回答
  • 2020-12-05 18:04

    The debugger gem can be used but it still has issues.

    Install byebug which was written for Ruby 2.0 debugging.

    For breakpoints, use the byebug command in your code instead of debugger.

    0 讨论(0)
  • 2020-12-05 18:12

    Use pry:

    gem install pry  
    gem install pry-debugger
    

    See "Debugging Ruby With Pry".

    0 讨论(0)
  • 2020-12-05 18:29

    Version 1.4.0 of the debugger gem now installs without problems. There are still some issues but this should be fixed soon.

    The debugger gem does not play well with Ruby 2. Instead, install the Byebug gem that is fully compatible with Ruby 2.

    0 讨论(0)
提交回复
热议问题