RSpec won't stop at breakpoint (alt)
I didn't want to muddy the water in this thread: http://devnet.jetbrains.com/message/5298605
I am running OSx 10.6.6
RVM 1.2.7
Ruby 1.9.2p136
Rails 3.0.5
Rubymine 3.1 RM-103.105
I can run spec tests fine. From terminal, rake spec run all fine. From the IDE, I added breakpoints and selected Debug... from the context menu for my spec test and here is what I am seeing "no tests found" :
/Users/marknadig/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug-ide-0.4.17.beta3/bin/rdebug-ide --port 49951 -- /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/bin/rspec /Users/marknadig/RubymineProjects/myapp/spec/models/collaboration_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --example Collaboration\ when\ adding\ a\ participant\ email\ should\ be\ recognizable\ by\ EmailActions
Testing started at 5:46 PM ...
Fast Debugger (ruby-debug-ide 0.4.17.beta3, ruby-debug-base 0.11.25) listens on 127.0.0.1:49951
/Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug-base19-0.11.24/lib/ruby_debug.bundle: warning: already initialized constant VERSION
/Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:36:in `<module:Debugger>': superclass mismatch for class CommandProcessor (TypeError)
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:4:in `<top (required)>'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:6:in `require_relative'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:6:in `<top (required)>'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
from /Users/marknadig/RubymineProjects/myapp/config/environments/test.rb:1:in `<top (required)>'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/railties-3.0.5/lib/rails/application/bootstrap.rb:11:in `block in <module:Bootstrap>'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
from /Users/marknadig/RubymineProjects/myapp/config/environment.rb:6:in `<top (required)>'
from /Users/marknadig/RubymineProjects/myapp/spec/spec_helper.rb:3:in `require'
from /Users/marknadig/RubymineProjects/myapp/spec/spec_helper.rb:3:in `<top (required)>'
from /Users/marknadig/RubymineProjects/myapp/spec/models/collaboration_spec.rb:1:in `require'
from /Users/marknadig/RubymineProjects/myapp/spec/models/collaboration_spec.rb:1:in `<top (required)>'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `block in load_spec_files'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `map'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load_spec_files'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:18:in `run'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:55:in `run_in_process'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:46:in `run'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in `block in autorun'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug-ide-0.4.17.beta3/lib/ruby-debug-ide.rb:112:in `debug_load'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug-ide-0.4.17.beta3/lib/ruby-debug-ide.rb:112:in `debug_program'
from /Users/marknadig/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug-ide-0.4.17.beta3/bin/rdebug-ide:87:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Empty test suite.
Process finished with exit code 1
what am I missing?
Thanks
Please sign in to leave a comment.
... removed for brevity...
Hi,
Thank you, we've reproduced the problem and are working on it. As a workaround we can suggest to disable ruby-debug19 gem in your Gemfile. Problem is caused by a conflict on runtime between ruby-debug19 and ruby-debug-ide gems.
Thank you, Roman. A co-worker tried the workaround and didn't work. So, we'll look forward to the fix.
Which error did he get? I'm asking because at first a checked on my development machine and it works.
Hi Roman,
He didn't remember, so I gave it a go. I commented out #gem 'ruby-debug19' and explicitly added gem 'ruby-debug-ide' in my gemfile and ran bundle install. When I tried to right-click and select 'Debug' on my rspec, it prompted "The gem ruby-debug-base19x required by the debugger is not currently installed...." I installed it and then it blew up with
/Users/myuser/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/myuser/.rvm/gems/ruby-1.9.2-p136@myapp/gems/ruby-debug-ide-0.4.17.beta3/bin/rdebug-ide --port 50163 -- /Users/myuser/.rvm/gems/ruby-1.9.2-p136@myapp/bin/rspec /Users/myuser/RubymineProjects/myapp/spec/models/email_action_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --example EmailAction\ build_for_user!\ should\ assign\ class\ and\ attributes
Testing started at 3:57 PM ...
Fast Debugger (ruby-debug-ide 0.4.17.beta3, ruby-debug-base 0.11.26) listens on 127.0.0.1:50163
/Users/myuser/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': no such file to load -- ruby-debug (LoadError)
from /Users/myuser/.rvm/gems/ruby-1.9.2-p136@myapp/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
For debugging using RubyMine you don't need to specify any debug gems. RubyMine will pass them on runtime automatically. You need just ordinary ruby/rails application which doesn't know about debugging. I recommend to remove ruby-debug-ide from gemfile.
Looks like somewhere in your app you manually requite "ruby-debug". As far as I know to enable console debugger you need both mention ruby-debug gem into Gemfile and launch app with --debug option or manually require 'ruby-debug' somewhere in app. I assume that you removed ruby-debug from Gemfile but left "require 'ruby-debug'" command in rails application. If you wont manage to find the require call please show full stacktrace mentioned above.
From what I can tell, shoulda-matchers has a dependency on ruby-debug.
I removed ruby-debug and shoulda-matchers from my gemfile and closed rubymine. I uninstalled my ruby-debug* gems from my rvm (gem uninstall ruby-debug19, ruby-debug-ide, ruby-debug-base19x). I opened the project in RM and right clicked on a rspec test -> debug and was prompted:
"The gem ruby-debug-base19x required by the debugger is not currently installed. Would you like to install it?". Yes and still bombs
Testing started at 1:41 PM ...
Fast Debugger (ruby-debug-ide 0.4.17.beta3, ruby-debug-base 0.11.26) listens on 127.0.0.1:51739
/Users/myuser/.rvm/gems/ruby-1.9.2-p136@rvmname/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': no such file to load -- ruby-debug (LoadError)
from /Users/myuser/.rvm/gems/ruby-1.9.2-p136@rvmname/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require'
So, something's still not quite right.
note: If this is something that will likely be addressed soon in a release, I can wait. Or, am I going to be running into this later too?
Thank you.
I did search for ruby-debug in all the project files and did not see any references.
BTW - debugging the actual rails app works just fine. Just the spec tests seems to be giving grief.
We are working on the problem. Dennis has already fix conflict between ruby-debug and ruby-debug-ide gem api. At the moment debug fails on latest ruby 1.9 patchlevel and we are going to update debug gems after problem will be fixed.
Did this ever get fixed? I still cannot get Rubymine to hit breakpoints in my rspec tests.
Hi, at first please describe your configuration and use case. The issue has been already resolved. If you don't mention any of debug related gems in Gemfile - debugger should work.
I am running:
OSx 10.7.1
RVM 1.6.20
Ruby 1.9.2p180
Rails 3.0.10
Rubymine 3.2.4 RM107.612
RSpec 2.6
I have controller specs and model specs that I would like to step through when my tests are not behaving as expected. I have set breakpoints in both the controller action that I am testing and the test case as well. I run Spork by going to "Tools->Run Spork DRb Server", and then I right click on my spec in the project tree and choose "Debug xxx_controller" from the context menu.
The spec completes successfully, but my breakpoints never get hit and I am unable to step through the code. There are no debug gems in my Gemfile. Here is the output in the console:
/Users/michaelhoffmeyer/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/michaelhoffmeyer/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug-ide-0.4.17.beta8/bin/rdebug-ide --port 52254 -- /Users/michaelhoffmeyer/.rvm/gems/ruby-1.9.2-p180/bin/rspec /Users/michaelhoffmeyer/Rails_Projects/stiQRdBU/spec/controllers/api/redemptions_controller_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter
Testing started at 7:07 AM ...
Fast Debugger (ruby-debug-ide 0.4.17.beta8, ruby-debug-base 0.11.30.pre2) listens on 127.0.0.1:52254
3 examples, 0 failures, 3 passed
Finished in 0.283962 seconds
Process finished with exit code 0
I appreciate you responding--we love the product and would REALLY like to be able to use this functionality!
We have gem 'ruby-debug19' in our gemfile for dev environment because we have some devs using RM, some other tools. Is that what is hosing us?
Posted on http://devnet.jetbrains.net/message/5320357#5320357 as well.
OSx 10.7.1
RM 3.2.4
RVM 1.8.3
Ruby 1.9.2p290
gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.10'
# Dependency management gems
gem 'bundler'
# Use MySQL as the database
gem 'mysql2'
#Authorization
gem 'cancan', '1.6.4'
# SSL Requirement
gem "ssl_requirement"
gem 'resque'
gem 'juggernaut'
# scheduler for things like email subscription processor
gem 'resque-scheduler', '2.0.0.b'
#File upload library
gem 'paperclip', '2.3.11'
gem 'aws-s3'
#amazon SES- email
gem "aws-ses", "~> 0.4.1", :require => 'aws/ses'
gem 'redis-dump'
gem 'drydock'
gem "pusher", "~> 0.8.1"
gem "pusher-client", :git => 'git://github.com/logankoester/pusher-client.git'
# for testing exception tracking
gem "airbrake", "~> 3.0.4"
#for CI test report
gem 'ci_reporter'
gem "deadlock_retry", "1.1.1"
group :integration, :demo, :production do
gem 'god'
gem 'newrelic_rpm', '3.1.2'
end
# Test/Development only gems
group :development, :perf, :test do
gem 'webrat'
gem 'capybara', '~> 1.0.1'
gem 'mocha'
gem 'rspec-rails'
gem 'factory_girl'
gem 'hpricot'
gem 'rspec'
gem 'shoulda-matchers'
gem 'cucumber', '>= 1.0.2'
gem 'cucumber-rails'
gem 'spork', '~> 0.9.0.rc'
gem 'cover_me', '>= 1.0.0.rc6'
gem 'launchy'
gem 'email_spec'
gem 'database_cleaner'
gem 'ruby-debug19'
gem 'capybara-firebug', '~> 0.0.9'
gem 'chronic', '>=0.2.3'
gem 'cucumber_spinner'
end
group :development, :perf do
# Deployment Gems
gem 'capistrano'
gem 'capistrano-ext'
gem 'ZenTest'
gem 'compass'
gem 'mongrel', '1.2.0.pre2'
end
group :perf do
gem "query_reviewer", "~> 0.1.3"
gem "bullet"
gem "ruby-growl"
end
# Authentication Gems
gem "devise", "1.4.5"
gem "omniauth", "~> 0.2.6"
gem 'acts-as-taggable-on'
#integration with third party
gem 'linkedin'
gem 'loofah-activerecord'
gem 'ri_cal'
A good friend found identified the issue .. my spec_helper.rb had:
require 'ruby-debug'
commenting that out resolved the problem.
This is in spec_helper since we have some devs using other IDEs, debugging from terminal.
Hope this helps others.