I’m trying to get the ruby debugger to breakpoint at a specific line in source.
Here’s what I did:
Added require “ruby-debug” in spec_helper.rb
You don’t need this ^^.
Added gem dependency to Gemfile (gem “ruby-debug”
In the spec, added before do breakpoint; 0; end
Use “debugger” instead of “breakpoint”.
Ran it with rspec spec/models/myspec.rb -d
This is correct ^^.
I had --drb option on, which caused all sorts of problems with the
debugger.
It would just skip right through the breakpoint/debugger statements with
the
–drb option on. Even though spork wasn’t running.
Removing the option got the debugger back on track.
Cheers,
Jason
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.