How to use the debugger with Ruby 2.0? How to use the debugger with Ruby 2.0? ruby ruby

How to use the debugger with Ruby 2.0?


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.


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.


Use pry:

gem install pry  gem install pry-debugger

See "Debugging Ruby With Pry".