How to use the debugger with ruby 2.0?

I know the debugger gem is not compatible yet with ruby 2.0 See here

In the changelog of ruby 2.0, we can see this :

Debug support

DTrace support, which enables run-time diagnosis in

production TracePoint, which is an improved tracing API

So my question is, is there something out of the box for debugging with ruby 2.0 ? Can somebody explain this to me?

How do I use Ruby debugger in Emacs?

I am writing Ruby in Emacs, but my Emacs skills are actually pretty low. What I can do, is open the project, TDD using M-x rinari-test, or play inferior Ruby in the second window using M-x run-ruby. N

Ruby debugger installation help !

I installer ruby-debugger but even after that , when I try to start the rails server with –debugger option I get a console error saying that ruby-debugger is not installed see the logs below :- :~

How to use OcaIDE debugger in Eclipse?

I am a bit new to this. I am not able to figure out that how to use the debugger? I am not able to view help contents either in eclipse.

Ruby Debugger installation Error

I am getting the following Error While installing ruby debugger In gemfile i added gem ‘ruby-debug19’, :require => ‘ruby-debug’ and run bundle install Installing linecache19 (0.5.12) with nativ

How to use ‘debugger’ and ‘pry’ when developing a gem? (Ruby)

I’m developing a gem, and my Gemfile looks like this: source :rubygems gemspec group :development, :test do gem pry gem debugger gem rake end However, I don’t want people to have to install pry

How can I use ruby-debugger inside of a resque job?

I’m looking for a command to start a worker process so that inside of the job’s perform method I can call debugger and have control thrown to the command prompt.

How to use debugger in Qt Creator

I use Qt Creator for C++ projects (non-Qt actually). This might be a dumb question, but how do you manage to use the debugger in Qt Creator? I have been using CDB along with VisualStudio or gdb along

How can I programatically call the ruby debugger from within a ruby program in Ruby 1.9?

I am writing a web based debugger for Ruby, but in order to do this I need to be able to call the Ruby debugger from within a Ruby program on the server side. Has this ever been done? Is this even pos

ruby: installing debugger

I can’t get debugger installed to work in my ruby files. Can anyone see what the problem is? I did ‘require debugger’ at the top of my file.rb and got this error when I ran ruby file.rb rubygems/custo

Ruby visual debugger run from linux terminal

Is there a ruby visual debugger that i can run from the linux terminal? And if so, how do i run it?

Answers

The version 1.4.0 of the debugger gem now installs without problems.

There are still some issues but this should be fixed soon.

EDIT :

The debugger gem does not play well with ruby 2, install the gem byebug that is fully compatible with ruby 2.

Gem debugger can be used but it still has issues.

Install gem byebug (written for ruby 2.0 debugging)

And for breakpoints, use byebug command in your code instead of debugger.

Use pry (pryrepl.org).

gem install pry
gem install pry-debugger

http://knomedia.github.io/blog/2013/01/21/debugging-ruby-with-pry/

As Alain said the gem byebug should do the trick, the only thing is you might have to also add require ‘byebug’ to the top of the file you want to debug.