2

Arg, looks like this is a fairly common problem but I can't seem to figure out how to get my debugger working. I've installed a myriad of gems to try to get this bad boy running but no luck. Here is a list for completeness. I've included my gemfile as well. As is probably quite obvious I'm a RoR newb. I'm using RubyMine as my IDE and upon trying to debug I get an error that states "The gem ruby-debug-base19x required by the debugger is not currently installed. Would you like to install it?". Of course, upon saying 'yes' to download the mirror is broken and the download fails resulting in the following error:

5:56:46 PM Error running Development: SponsorBid: Cannot start debugger. Gem 'ruby-debug-ide' isn't installed or its executable script 'rdebug-ide' doesn't exist.

LOCAL GEMS

GEMFILE

Collin White
  • 640
  • 1
  • 11
  • 27
  • 2
    You've made all possible mistakes: using wrong debug gems, using debugger gem, there are 2 questions (with answers) that will solve your problem: http://stackoverflow.com/a/10325110/104891, http://stackoverflow.com/a/11674999/104891. – CrazyCoder Aug 11 '12 at 00:00
  • Thanks! your tips were extremely helpful. I'm not getting some errors about other files not being found Cannot connect to the debugged process at port 55473 in 10s: Error Output: /Users/Collin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- /Users/Collin/.rvm/gems/ruby-1.9.3-p194/gems/linecache19-0.5.13/lib/../lib/trace_nums19 (LoadError) – Collin White Aug 11 '12 at 00:25
  • First link already contains the solution for the linecache19 problem. – CrazyCoder Aug 11 '12 at 00:36
  • The path for the linecache19 in the first link seems to just timeout (no data is transfered). Using the gem installer I get this gem install linecache19-0.5.13.gem ERROR: Could not find a valid gem 'linecache19-0.5.13.gem' (>= 0) in any repository – Collin White Aug 11 '12 at 00:39
  • 1
    ftp://ftp.intellij.net/pub/.idea/rubymine/linecache19-0.5.13.gem – CrazyCoder Aug 11 '12 at 01:28
  • Awesome! That got it working! – Collin White Aug 11 '12 at 01:42

2 Answers2

11

Even though this question duplicates two other questions here, I'll answer it for the sake of completeness.

In order to debug from RubyMine you must use only 2 debug gems:

  • ruby-debug-base19x
  • ruby-debug-ide

Exactly these gems must be used, not ruby-debug-base19, not ruby-debug19, not debugger . All the other debug gems must be uninstalled and removed from the Gemfile.

See this answer for the details how to install proper debug gem versions. If you have a problem downloading linecache19-0.5.13.gem gem, try this mirror instead.

Verify with gem list that you have the following or more recent versions installed:

ruby-debug-base19x (0.11.30.pre10)
ruby-debug-ide (0.4.17.beta9)

No other debug gems should be listed by this command.


As stated in another answer, debugger gem must not be used, it will conflict with the debug gems used by RubyMine and debugger will not work. You must uninstall this gem, remove it from the Gemfile and ensure that your code doesn't call any methods from this gem and is not trying to load it.

Happy debugging!


As suggested by @Anjan, your Gemfile for debugging can look like this:

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

Just run bundle install to get the proper versions of the required debug gems.

Community
  • 1
  • 1
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • Thank you! This was exactly what I needed on my RubyMine version 4.5.2 – oldfartdeveloper Aug 29 '12 at 23:42
  • This might be good information to have near http://www.jetbrains.com/ruby/webhelp/remote-debugging.html It took a good bit of digging just to find this. – pizza247 Dec 06 '12 at 23:04
  • 1
    For those still having problems after following this answer, if you are on Mac OSX make sure your computer name is set in System Preferences | Sharing. It took me forever to figure this out. More detail here: http://youtrack.jetbrains.com/issue/RUBY-8990 – Jeff Cutler-Stamm Feb 20 '13 at 18:50
  • I'm using IDEA 12, and when I removed all debugging gems from my Gemfile, **including `ruby-debug-base19x` and `ruby-debug-ide`**, it finally all worked. – duma Jun 05 '13 at 16:01
  • @duma That is expected as the IDE will install the correct debugger gems automatically. – CrazyCoder Jun 05 '13 at 16:02
  • @duma do you have breakpoints working ? I have this in the console: "Fast Debugger (ruby-debug-ide 0.4.17, ruby-debug-base19x 0.11.30.pre12) listens on 127.0.0.1:37772" so it seems that is working, but IDEA12 is just ignoring the breakpoints an the debugger is not stopping. – dawez Jun 24 '13 at 21:56
0

This is what I used in my Gemfile to install the required gems through bundler:

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

No manual gem installation required and will automatically work on your fellow developers' computers.

Anjan
  • 1,613
  • 1
  • 19
  • 25