views:

61

answers:

1

How do you guys debug your Rails apps? I have seen a link to datanoise.com that is supposed to show how to use ruby-debug with Textmate using a bundle.. but it looks like the page is down. Does anyone know how to set this up? Thanks!

A: 

@johnmcaliley - I debug my rails apps by simply adding 'debugger' to my code:

method_call
variable = method_call + 5
debugger
#more code

Then start your rails web server with the --debugger option:

script/server --debugger

This requires you have a gem installed, ruby-debug, I think. Check out this screencast for a good demo: http://railscasts.com/episodes/54-debugging-with-ruby-debug

However, it doesn't hook into textmate.

Robert, thanks for the reply. This was an option I was looking at and the screencast you provided helped me understand how it works. But I am still looking for something that will hook in to Textmate. I am working with Rails 3 beta and Ruby 1.9.2. I had to install "ruby-debug19" for Ruby 1.9 compatibility. I also installed RubyAMP bundle and it provides mechanisms to set breakpoints in Textmate and run the debugger from a terminal. Still trying to hack it to get Rails 3/Ruby 1.9 to work.
cowboycoded
@johnmcaliley, I did some searching and came up with this which might interest you (it did me....I've been contemplating trying out this mythical text-mate). Apparently there is a ruby or rails debugging bundle for textmate that allows you to hook the other way. Check out http://objectmix.com/ruby/758472-ruby-debug-textmate.html http://blog.macromates.com/2008/textmate-ruby-tricks/ and http://macdevelopertips.com/textmate/textmate-execute-inline-ruby.html
Thanks for the links Robert. That is what I was looking for. I will let you know how well it works with Rails 3/ Ruby 1.9.
cowboycoded
BTW, you should really try out Textmate. You will be amazed at the power of bundles and its speed. My productivity increased noticeably after I switched to TM. The lack of a built-in debuggger is my only gripe with the IDE.
cowboycoded