Debug not breaking when running rake db:migrate

I'm trying to debug a Rails migration script and I set a few breakpoints in the migration methods and invoked 'rake db:migrate', but none of the breakpoints were hit. In the console I can see that Ruby was invoked with rdebug-ide and a port value and then a comment that Fast Debugger (ruby-debug-ide) was listening on that port.

Is there anything special about the way rake or the db:migrate script runs that I wouldn't be able to debug it?

I'm running RubyMine 1.1.1 on Windows, with Ruby 1.8.6.

3 comments
Comment actions Permalink

Hi Nathan,

I'll check it today. I know about the same problem with unit tests. For testing 'test' rake task executes external ruby command so debugger wont be attached and breakpoints in ruby tests will not work.

0
Comment actions Permalink

I suppose it is bug in ruby-debug gem. I've filed an issue [#26785] - http://rubyforge.org/tracker/index.php?func=detail&aid=26785&group_id=1900&atid=7436

As a workaround you can put breakpoint earlier and then use stepping. E.g.

# activerecord-2.3.2/lib/active_record/migration.rb ...         result = nil         time = Benchmark.measure { result = send("#{direction}_without_benchmarks")} #break point is here ...




0
Comment actions Permalink

Interesting. Thanks for following up.

0

Please sign in to leave a comment.