Search code examples
ruby-on-rails-3rubymine

RubyMine debugger won't run


I'm becoming extremely frustrated with RubyMine, because getting the debugger to run is unacceptably difficult. I've got this in my gemfile,

gem 'ruby-debug-ide' if ENV["RM_INFO"]
gem 'ruby-debug-base19x', '0.11.30.pre12' if ENV["RM_INFO"]

(note that I do not have the debugger gem listed), and bundle install gives me, in part,

Using debugger-ruby_core_source (1.2.2) 
Using ruby-debug-base19x (0.11.30.pre12) 
Using ruby-debug-ide (0.4.16) 

and this in Gemfile.lock

ruby-debug-base19x (0.11.30.pre12)
  debugger-ruby_core_source (>= 1.1.4)
  rake (>= 0.8.1)
ruby-debug-ide (0.4.16)
  rake (>= 0.8.1)

Again, the debugger gem is nowhere to be found. So why do I still get this when I try to debug my Rails application?

Exception: undefined method `prepare_debugger' for Debugger:Module
  /Users/cbmanica/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-ide-0.4.17.beta17/lib/ruby-debug-ide/multiprocess/pre_child.rb:60:in `start_debugger'
  /Users/cbmanica/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-ide-0.4.17.beta17/lib/ruby-debug-ide/multiprocess/pre_child.rb:32:in `block in pre_child'
  /Users/cbmanica/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-ide-0.4.17.beta17/lib/ruby-debug-ide/multiprocess/pre_child.rb:26:in `times'
  /Users/cbmanica/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-ide-0.4.17.beta17/lib/ruby-debug-ide/multiprocess/pre_child.rb:26:in `pre_child'
  /Users/cbmanica/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-ide-0.4.17.beta17/lib/ruby-debug-ide/multiprocess/starter.rb:9:in `<top (required)>'

Solution

  • Ensure your Gemfile contains this:

    gem 'linecache19', '>= 0.5.13', :git => 'https://github.com/robmathews/linecache19-0.5.13.git'
    gem 'ruby-debug-base19x', '>= 0.11.30.pre12'
    gem 'ruby-debug-ide', '>= 0.4.17.beta17'
    

    As described in my other answer the pre-release versions of the gems are required.