Debugging Ruby 2.2 with Eclipse

3.8k views Asked by At

I'm trying to use step-through debugging in Ruby 2.2. I see that byebug is the debugger of choice for Ruby 2.x, but Eclipse doesn't appear to recognise it. Steps to reproduce:

  1. Do a fresh install of the Windows 64bit distrib of Ruby 2.2.2 (I'm using Windows 8.1)
  2. Install the Ruby 2.0 64bit DevKit - version 'DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
  3. Add both Ruby and DevKit bin directories to PATH env variable
  4. gem install byebug
  5. Debug in Eclipse (Version: Luna Service Release 1 (4.4.1); Build id: 20140925-1800 & Dynamic Languages Toolkit - Ruby Development Tools 5.0.0.201306060709)

Result:

Debugging Engine not started The 'Fast Ruby Debugger (ruby-debug)' is selected, but the 'ruby-debug' or 'debugger' gems don't seem to be installed in the selected Ruby Interpreter (C:\Apps\Ruby22-x64\bin\ruby.exe)

I tried installing the debugger gem, but it apparently doesn't support Ruby 2.x. A response to this question suggests byebug and Eclipse don't mix, but it wasn't part of the OP's question and isn't addressed by anyone else.

Anyone able to help? If I need to regress to an earlier version of Ruby, what version should I be using?

2

There are 2 answers

0
tcrespog On

You could try with the Ruby Built-In Debugger, on Eclipse go to Window > Preferences > Ruby > Engines and choose "Ruby Built-In Debugger" in the dropdown list.

Not sure if this works with Ruby 2.x, but for me is working with Ruby 1.9.3.

0
sndyuk On
  • Ruby 2.2
  • Rails 4
  • No extra Gem

1. Choose "Ruby Built-In Debugger":

enter image description here

2. Add a Debug Configuration:

  1. Input your command on "Lunch script"
  2. "Debug".

enter image description here