RubyMine debugger improved

Oleg Shpynov

Hello guys,

During the last week we’ve been working hard on improving RubyMine built in debugger and here are some results.

As you may know RubyMine uses ruby-debug-base and ruby-debug-ide gems inside its graphical debugger. Many of the problems experienced by our users when using the debugger in RubyMine are actually caused by bugs in those gems. Fortunately, we’ve been able to fix the most problematic of these third party gems bugs, such as segmentation faults, wrong local variables values, not stopping on breakpoints and some others.

Besides these fixes, we’ve done lots of improvements on RubyMine’s side such as:

  • Improved variables view with fields, global variables and even constants used in scope
  • Fixed problem with stealth breakpoints while working with several projects simultaneously
  • Jump to source is available now for debugger variables
  • Check that you  are using the latest available debug gems
  • Bundled fixed gems versions while our fixes are not yet accepted to the mainstream

Here is a screenshot of the new debug variables view:
You can see that RubyMine automatically shows you the values of @book and Book used in scope.

We are pretty sure that all these improvements will definitely improve your debugging experience with RubyMine. All of them will be available in coming RubyMine 3.0 RC build. Stay tuned!

Develop with pleasure!
-JetBrains RubyMine Team

Comments below can no longer be edited.

28 Responses to RubyMine debugger improved

  1. Russell Garner says:

    November 13, 2010

    Fantastic news! That xml_printer.rb bug with segfault has been the bane of my life for the last 6 months. Great that you’ve gone above and beyond by fixing this for the community. Congrats!

  2. Martin Krauskopf says:

    November 13, 2010

    That’s great that you guys started to cooperate on the backend. Worth to note that majority of works on the backend (those buggy gems ;), that are used by Aptana, NetBeans and RubyMine) was done by cooperation of Eclipse (Aptana) and NetBeans guys who actually made the backend (the half of every IDE’s debugger) directly free for RubyMine as well. Seems that the turn is now on you and that you are moving well ;). Good luck with the IDE! Cheers.

  3. Dan Michaelson says:

    November 13, 2010

    When using the new RC, when I start the debugger and it says my debugger gems are outdated, if I say yes to upgrade, then I get this error: “Error running Development. Failed to install gems. Bundled debug gems not found.”

    The debugger works fine if I don’t upgrade, and attaching gems and stuff has always seemed to work fine… Is there something I need to configure?

    This improvement sounds great though.

  4. says:

    November 13, 2010

    @Martin, thank you =)

    @Dan, seems we missed one bundled gem, please download it from and put into /Applications/RubyMine . We’ll reupload build as soon as possible.

  5. Dan Michaelson says:

    November 13, 2010

    Hm, did that, and restarted RM, no improvement.

  6. Dan Michaelson says:

    November 13, 2010

    Nevermind– Had to restart RM again for some other reason, and upon re-launching this second time, it worked. Go figure. Thanks for the updated file.

  7. Ron says:

    November 24, 2010

    Does this work for ruby 1.9? When I run a cucumber feature in debug, it keeps telling me I don’t have ruby-debug-ide. When I tell it to install, it fails. This is on a mac. I managed to install them manually and it works on the command line, and running the test without debug works in rubymine, but when I run the test in rubymine, I get

    NoMethodError: undefined method `run_init_script’ for Debugger:Module
    ./features/step_definitions/debug_steps.rb:2:in `/^I debug$/’
    /Users/rmcclain/RubymineProjects/netatlas-rails/features/login.feature:12:in `And I debug’

    I’m just evaluating rubymine for the first time. It looks really nice, but I need the debugger working before I can fork out for it 😉

  8. Ron says:

    November 24, 2010

    If I add ruby-debug19 to my Gemfile, I get a different error:

    superclass mismatch for class RemoteInterface (TypeError)
    /Users/rmcclain/.rvm/gems/ruby-1.9.2-preview3/gems/ruby-debug19-0.11.6/cli/ruby-debug/interface.rb:128:in `’
    /Users/rmcclain/.rvm/gems/ruby-1.9.2-preview3/gems/ruby-debug19-0.11.6/cli/ruby-debug/interface.rb:1:in `

  9. Dennis.Ushakov says:

    November 24, 2010

    Please try doing File | Synchronize before installing bundled gems. In case that doesn’t help, try installing them manually from /Applications/RubyMine-3.0/rb/gems (you’ll need ruby-debug-base19 and ruby-debug-ide). Problems with superclass mismatch are fixed in that versions

  10. Ron says:

    November 24, 2010

    Thanks for the reply. I’m still not having any luck.

    I removed the existing gems from my .rvm directory, redownloaded rubymine 3.0b2 to make sure i’m up to date and did the following:

    gem install /Applications/RubyMine — –with-ruby-include=/Users/rmcclain/.rvm/src/ruby-1.9.2-preview3

    gem install /Applications/RubyMine — –with-ruby-include=/Users/rmcclain/.rvm/src/ruby-1.9.2-preview3

    both compiled and installed ok. did a bundle install just to be safe. that went fine.
    Gemfile contains:
    gem ‘ruby-debug19’, ‘0.11.6’, :require =>’ruby_debug’
    gem ‘ruby-debug-base19’, ‘0.11.25.jb2’
    gem ‘ruby-debug-ide’, ‘0.4.15’

    I set the versions because even after deleting gems in rvm, when installing ruby-debug-ide, it seemed to install ruby-debug-base19-0.11.24 and use that.

    If I remove the ruby-debug19 from Gemfile, I get:
    NoMethodError: undefined method `run_init_script’ for Debugger:Module

    With it enabled, I still get:
    `’: superclass mismatch for class RemoteInterface (TypeError)

    ~/RubymineProjects/netatlas-rails(125)% bundle list |grep debug
    * ruby-debug-base19 (0.11.25.jb2)
    * ruby-debug-ide (0.4.15)
    * ruby-debug19 (0.11.6)

    I noticed when I installed ruby-debug-ide, that it seemed to install a separate copy of ruby-debug-base 0.11.24, even though 0.11.25 is the one that is packaged in /Applicatations/Rubymine-3.0
    So I end up with two copies, and the .24 is what ends up in the bundle.

    What exactly should be in my Gemfile?


  11. Dennis.Ushakov says:

    November 25, 2010

    Ron, we’ve reworked debug launch mechanism since RC2, so adding debug gems to the bundle won’t be needed anymore.

  12. Ron says:

    November 25, 2010

    thanks for your help. i got it working. turns out, i’m an idiot and was trying to put actual ‘breakpoint’ and ‘debugger’ statements in the code. it apparently doesn’t like that at all. stripping out all references to ruby-debug anything in the gemfile and code and using the ide to set breakpoints and it works. long story short, i’m an idiot. rubymine seems pretty sweet so far 😉

  13. Markus says:

    December 9, 2010

    Hm, i had to do remove all ruby-debug-* gems that were installed on my machine (macosx 10.6) and then issue this command, to get debugging to work:

    sudo gem install –local ./ruby-debug-ide-0.4.15.gem

    Rubymine offers to install the gem but always fails on my machine, so i had to resort to the manual step.

    Maybe that helps some other users…

  14. Y Kamesh Rao says:

    December 27, 2010

    Markus’s way above worked for me too. Thanks Markus.

    RubyMine and all of jetbrains products are beautiful.

  15. Paul says:

    January 26, 2011

    I have just upgraded from Ruby 1.8.6 to 1.8.7 (Windows one click installer) and I can no longer run the debugger. The problem is that RM can’t install ruby-debug_ide-0.4.15. It says I need to use the Devkit for the native gem but is there another way around that?
    For example the Postgress gem (0.9) came with the native libraries (0.10 didn’t) which meant I didn’t need to use the Devkit

    Thanks for any help!

  16. Dennis.Ushakov says:

    January 27, 2011

    Paul, please try installing this version of ruby-debug-ide gem

  17. graham says:

    February 7, 2011

    thats great, can you tell me where I should put this file? I am a ruby newbie and thought that rubymine would give me a gentle introduction, so far its being nothing but painful with mysql and mysql2 not working, or sqlite3, and I still dont have debugging.

  18. graham says:

    February 7, 2011

    ok I did the following
    macgem install –local ./ruby-debug-ide-0.4.17.alpha.gem
    restarted rubymine and then hit debug again
    ruby-debug-base19 required by the debugger is not currently installed. Would you like to install it?
    hit yes and after a few minutes I get

    Failed to install gems. Following gems were not installed: /Applications/RubyMine Error installing ruby-debug-base19-0.11.25.jb3.gem: ERROR: Failed to build gem native extension. /Library/Frameworks/MacRuby.framework/Versions/0.8/usr/bin/macruby extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: –with-opt-dir –without-opt-dir –with-opt-include –without-opt-include=${opt-dir}/include –with-opt-lib –without-opt-lib=${opt-dir}/lib –with-make-prog –without-make-prog –srcdir=. –curdir –ruby=/Library/Frameworks/MacRuby.framework/Versions/0.8/usr/bin/macruby /Users/grahamcunningham/.gem/macruby/1.9.2/gems/linecache19-0.5.11/ext/trace_nums/extconf.rb:2:in ` ‘: no such file to load — ruby_core_source (LoadError) Gem files will remain installed in /Users/grahamcunningham/.gem/macruby/1.9.2/gems/linecache19-0.5.11 for inspection. Results logged to /Users/grahamcunningham/.gem/macruby/1.9.2/gems/linecache19-0.5.11/ext/trace_nums/gem_make.out /Applications/RubyMine Error installing ruby-debug-ide-0.4.15.gem: ERROR: Failed to build gem native extension. /Library/Frameworks/MacRuby.framework/Versions/0.8/usr/bin/macruby mkrf_conf.rb unknown: warning: already initialized constant HELP Gem files will remain installed in /Users/grahamcunningham/.gem/macruby/1.9.2/gems/ruby-debug-ide-0.4.15 for inspection. Results logged to /Users/grahamcunningham/.gem/macruby/1.9.2/gems/ruby-debug-ide-0.4.15/ext/gem_make.out linecache19 (0.5.11): Error installing linecache19: ERROR: Failed to build gem native extension. /Library/Frameworks/MacRuby.framework/Versions/0.8/usr/bin/macruby extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: –with-opt-dir –without-opt-dir –with-opt-include –without-opt-include=${opt-dir}/include –with-opt-lib –without-opt-lib=${opt-dir}/lib –with-make-prog –without-make-prog –srcdir=. –curdir –ruby=/Library/Frameworks/MacRuby.framework/Versions/0.8/usr/bin/macruby /Users/grahamcunningham/.gem/macruby/1.9.2/gems/linecache19-0.5.11/ext/trace_nums/extconf.rb:2:in ` ‘: no such file to load — ruby_core_source (LoadError) Gem files will remain installed in /Users/grahamcunningham/.gem/macruby/1.9.2/gems/linecache19-0.5.11 for inspection. Results logged to /Users/grahamcunningham/.gem/macruby/1.9.2/gems/linecache19-0.5.11/ext/trace_nums/gem_make.out

  19. says:

    February 7, 2011

    Graham, please try running gem install ruby_core_source and try installing debug again

  20. simon says:

    February 16, 2011

    Hi dennis,

    my Problem might be quite similar. RM wants to install ruby-debug-base19x and linecache19 and fails. I also can’t install the gems in commandline. It says the error with the native extension. But, I installed DevKit and tried

    install rdiscount –platform=ruby
    ruby -rubygems -e “require ‘rdiscount’; puts‘**Hello RubyInstaller**’).to_html”

    like it says in this manual ( Output was working.

    So my DevKit and gcc should work properly.

    Im running Win XP / SP 3, RubyMine3.1 and RubyStack2.1-1

    Everything worked well so far, just debugging doesn’t want to work.

  21. says:

    February 16, 2011

    Simon, could you please provide full error message at our bugtracker

  22. simon says:

    February 17, 2011

    Hi Dennis,

    problem has been resolved. It was my stupid Kaspersky which put some files like make.exe, sh.exe, ruby.exe under quarantine.

    Thank you for your fast answer.

  23. Phillip Miller says:

    May 22, 2011

    I recently upgraded my Intellij IDEA to 10.5 and installed the latest ruby plugin 3.1. My project is written in 1.9.2 using RVM and debugger worked fine previously. I’m now getting an install error which says I don’t have ruby-debug-base. Listing my gems I’ve got ruby-debug-base19 (0.11.25), ruby-debug-ide (0.4.17.beta3, 0.4.16), ruby-debug19 (0.11.6), ruby_core_source (0.1.5) and its dependencies all installed.

    Do I need to make an alias or somehow trick IDEA into using debug19?

  24. Phillip Miller says:

    May 22, 2011

    Sorry, I’ve also selected the ruby 1.9.2 as my SDK and synchronized, opened and closed the project many times to no avail.

  25. John says:

    May 24, 2011

    OS X 10.6.7 here using RVM. I did:
    gem install ruby-debug-base19x — –with-opt-include=$(echo ~/.rvm/src/ruby-1.9.2-head)
    … and it worked. RubyMine debugger runs fine now.
    Hope this helps.

  26. Phillip Miller says:

    May 24, 2011

    I installed ruby-debug-base19x as John suggested without any luck. I’ve also got ruby-debug-ide (0.4.17.beta5) installed. Error still says ruby-debug-base required and when it tries to install under my 1.9.2 RVM path of course linecache throws the can’t handle 1.9.x error.

    If I skip the gem install, IDEA tells me ruby-debug-ide isn’t installed or the executable rdebug-ide doesn’t exist. Running ‘which rdebug-ide’ in a terminal returns /home/philmill/.rvm/gems/ruby-1.9.2-p180/bin/rdebug-ide. Like I said, I’ve selected the 1.9.2 SDK and I can see all the required gems listed.

    My system is Ubuntu 10.10.

  27. Phillip Miller says:

    June 4, 2011

    So I created a gemset under my 1.9.2 install with the following
    rvm gemset create tester

    Switched into that gemset with the following
    rvm 1.9.2@tester

    Created a fresh rails app, selected my tester SDK, and ran the debugger. IDEA installed ruby-debug-base19x (0.11.27) and ruby-debug-ide (0.4.17.beta3) at which point it failed to load.

    I uninstalled the beta3 version and manually installed the beta5 version, reran the debugger, and poof it works as expected. So IDEA works and my other project must be setup incorrectly.

    Hope this helps someone else.


  28. John McCaffrey says:

    September 4, 2011

    Phillip thank you so much, I was going crazy with getting segfaults and not being able to debug my app (rubymine 3.2.3 won’t even load my project, had to drop down to 3.1.1)

    uninstalling ruby-debug-ide-0.4.17.beta3 fixed my issue


Subscribe for updates