Debugger won't stop at breakpoints
When I run the debugger on an RSpec spec folder, RubyMine runs the tests but won't stop at breakpoints.
When I run the debugger on a single RSpec file, it runs the tests if there aren't any breakpoints, but if I have a breakpoint, it waits 15 seconds at the breakpoint, then fails with this output:
C:/Ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-debug/xml_printer.rb:106: [BUG] Segmentation fault
ruby 1.8.6 (2008-08-11) [i386-mswin32]
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I have no problems running RSpec tests without the debugger, whether it's a single example, a single file, or a folder.
I'm running Windows XP, Ruby 1.8.6, and jdk1.6.0_10.
Also, I have another question: Why do I have to set up a configuration for each script or example I want to run? Why can't I right click on a script or example and run or debug it (like in ReSharper)? Or select a subset of examples and run them?
I'm a big fan of ReSharper, and am looking forward to purchasing RubyMine, but it's not up to the level of ReSharper on running and debugging tests. I'm hoping that I'm just doing something wrong and you can make it all work the way I'm used to in other tools.
Thanks for your help.
Please sign in to leave a comment.
I just wanted to add that this behavior is still occurring using the RC (build 873).
Hi Drhodes,
It's known issue (you can track changes for http://www.jetbrains.net/jira/browse/RUBY-3825 ) issue. Actually RM executes with attached debugger only our internal ruby script which looks for spec files but then this script executes specs in other process.
Please execute "gem list" command and show us which versions of ruby-debug, ruby-debug-base gems are installed.
If rspec gem is attached to your project (see RubyMine's Gem manager) and if your rspec files requires "spec" directly on indirectly(e.g. via some helper ruby script) RubyMine will allow to execute
* single spec example - place caret inside example's closure and run it from context menu
* whole spec file - place caret in any place except spec example's closure
* all spec test for folder - right click on any folder.
You shouldn't create run configurations manually - RubyMine always creates them automatically. You may just save some of that configurations for quick access.
I have the following ruby-debug gems installed:
ruby-debug (0.10.3)
ruby-debug-base (0.10.3, 0.10.2)
ruby-debug-ide (0.4.5, 0.3.1)
But under Settings, Gems, it shows that the latest versions of these are attached to the project, but it also displays the following error below that:
Gems required for project are not attached: ruby-debug-base(~> 0.10.3.0)
I did get the context menu to display the Run/Debug options. I thought I had the spec required in a dependency file, but it was missing.
Now I can click inside an example's closure, as you said, select Debug, and the debugger comes up and stops at the breakpoint. But it won't respond to F8 or any other debugging actions. After a few seconds, if stops, and the console shows the same Segmentation fault as in my original message.
I have a different project where I can now successfully debug spec examples, files, and folders, so it may be something specific to this project.
Actually there is no sense in attaching ruby-debug* gems to RubyMine projects because they aren't required for code insight.
Do you use some C extensions for Ruby? For debugging we use API provided by opensource ruby-debug project (http://rubyforge.org/projects/ruby-debug/) may be it is their bug/limitation for some specific configurations/projects. I don't think that it is RubyMine issue.
Thanks, I've filed a bug against rubygems dependencies support - http://www.jetbrains.net/jira/browse/RUBY-3830. Feel free to vote, track status and comment it.
I detached the ruby-debug* gems, uninstalled them and re-installed the latest versions, but I'm still getting the error. I'm not aware of any C extensions, but I'm not sure how to check. I didn't see anything being built during the gem install of ruby-debug*.
Also, I checked http://rubyforge.org/projects/ruby-debug/ and saw a bug report there by Oleg Shpynov that looks similar to the error I'm getting:
[#24415] Segmentation fault while debug Rails 2.2
http://rubyforge.org/tracker/index.php?func=detail&aid=24415&group_id=1900&atid=7436
It looks like that bug hasn't yet been addressed.