Reputation: 4487
I faced this exception when debugging with RubyMine...
Debugger.start is not called yet.
Upvotes: 17
Views: 2787
Reputation: 5925
I had only one dependency that was breaking RubiMine's debugger: pry-debugger
. Replacing it with pry-nav
, which doesn't depend on debugger
, resolved the problem.
Upvotes: 0
Reputation: 590
The other solutions won't work if you check in your Gemfile.lock - it will vary depending on what machine it was generated on (didn't try it, but pretty sure this is true).
Instead, I put the gem in a separate, non default section in the Gemfile:
group :debugging do
gem 'debugger'
end
Then, in application.rb, I require it conditionally. Also, I didn't have RM_INFO, so I check RUBYLIB env var:
Bundler.require(:default, Rails.env) if defined?(Bundler)
unless ENV['RUBYLIB'] =~ /RubyMine/
require 'debugger'
end
Upvotes: 0
Reputation: 61
As an addendum to Mustafah's comment, it took me a while to track down this variant of the issue:
gem 'pry-full'
gem 'debugger'
Both of these lines were causing the problem, so I had to change to:
unless ENV['RM_INFO']
gem 'pry-full'
gem 'debugger'
end
How do you know which gems might indirectly be loading the debugger gem? Look in your Gemfile.lock for entries which suggest this depedency:
pry-debugger (0.2.2)
debugger (~> 1.3)
pry (~> 0.9.10)
Upvotes: 6
Reputation: 866
For others who run into this and can't remove debugger from the Gemfile, it's worth following the source link Mustafah provided.
Further updates to the discussion point out that you can add unless ENV['RM_INFO']
to the Gemfile (and after any require of the debugger gem) to use the RM debugger and allow others on the project the command line debugger.
Upvotes: 0
Reputation: 4487
After a while of trying other proposed solutions, I found that I had the following in the gem file:
gem "debugger"
This causes a conflict somehow for the debugger... Removing this line solved it to me...
Thanks...
Source: Debugger crashes when it hits the first breakpoint
Upvotes: 29