Debugging Rails - Request for tips, tricks and hacks

Hi,

I am wondering if you guys would be kind enough to point me to resources that you find are valuable to your debugging efforts, or would be to someone beginning to become structured about efficient debugging.

Relating to that, I would like to automagically drop to the debugger just before the first failing spec, does anyone know of a gem / hack that provides that or could point me to what I could use to hack that together myself?

TIA,

Joe

Hopefully someone else will come in with more input on debugging as that is required sometimes. But I don't find myself using a debugger very often. I write tests, then the simplest piece of code to make them work and I'm running the tests (even for a large app) continuously using autorun, so I find that if I get a regression, it's in the last 2-3 git commits which really helps figuring things out.

There are definitely conditions where a debugger can be helpful, but it is worth pointing out that it's a bit of a "development smell" if you need one very often. It usually suggests too tight coupling between classes and/or a lack of unit level specs/tests.

Best Wishes, Peter

Hopefully someone else will come in with more input on debugging as that is required sometimes. But I don’t find myself using a debugger very often. I write tests, then the simplest piece of code to make them work and I’m running the tests (even for a large app) continuously using autorun, so I find that if I get a regression, it’s in the last 2-3 git commits which really helps figuring things out.

There are definitely conditions where a debugger can be helpful, but it is worth pointing out that it’s a bit of a “development smell” if you need one very often. It usually suggests too tight coupling between classes and/or a lack of unit level specs/tests.

Thanks for your input Peter, I definitely agree about the benefits of tests :slight_smile: The issue is that we are in the process of migrating from Rails 2.3.5 to 3.0.7 and are faced with 2k+ failing tests.

We know exactly the commit that caused it :wink: But we need to fix debug / fix the app within those parameters.