Can't debug unit tests in Mountain Lion (RubyMine 4.5.1)

Active breakpoints cause an exception to occur when debugging unit tests in Mountain Lion.  See stack trace below.  Alos, breakpoints work fine when debugging a Rails application.

/opt/local/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) -Itest /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/bin/rdebug-ide --dispatcher-port 50477 --port 50478 -- /Users/warnick/Documents/Plansource/source/benefits_trunk/test/unit/coverage_test.rb --name=test_record_user_changes_plan_gi_life_event
Testing started at 3:06 PM ...
Fast Debugger (ruby-debug-ide 0.4.17.beta14, ruby-debug-base 0.10.5.jb2) listens on 127.0.0.1:50478
65245: Exception in DebugThread loop: Invalid argument
Backtrace:
/opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/interface.rb:194:in `write'
  from: /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/interface.rb:194:in `printf'
  from: /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/interface.rb:194:in `print'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide/ide_processor.rb:142:in `print'
  from: /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/command.rb:192:in `print'
  from: /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/threads.rb:8:in `display_context'
  from: /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/threads.rb:53:in `execute'
  from: /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/threads.rb:52:in `each'
  from: /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/cli/ruby-debug/commands/threads.rb:52:in `execute'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide/ide_processor.rb:89:in `process_commands'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide/ide_processor.rb:86:in `catch'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide/ide_processor.rb:86:in `process_commands'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide.rb:160:in `start_control'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide.rb:144:in `initialize'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide.rb:144:in `new'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide.rb:144:in `start_control'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide.rb:106:in `start_server'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide.rb:110:in `prepare_debugger'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/lib/ruby-debug-ide.rb:124:in `debug_program'
  from: /Users/warnick/.gem/ruby/1.8/gems/ruby-debug-ide-0.4.17.beta14/bin/rdebug-ide:118
  from: -e:1:in `load'
  from: -e:1

Process finished with exit code 1

3 comments
Comment actions Permalink

Hello Ryan,

you have CLI debug gem (ruby-debug) required somewhere, most probably in the Gemfile, it's a known conflict between CLI and IDE debug gems. Please remove this requirement and debugging will work.

0
Comment actions Permalink

Thanks.  I had to completely remove the ruby-debug gem to get it to work.  The Gem was not referenced anywhere that I could see, so I don't know RubyMine insists on including it.

0
Comment actions Permalink

Sometimes it can be indirectly required from other gems when specifying --debug flag or stuff like that. Good to hear that debugging is working for you now

0

Please sign in to leave a comment.