Read my latest article: Announcing RailsDeveloper (posted Wed, 01 Sep 2010 17:01:00 GMT)

Request for Rails Debugging Tools

Posted by Robby Russell Tue, 10 Jan 2006 02:30:00 GMT

61 comments Latest by 123 Tue, 31 Aug 2010 02:24:56 GMT

Howdy partners!

I hereby have a proposition for you all. Besides using breakpoint for debugging your Rails applications what other tools do you use? When I say debugging... I mean… tracking down problems and issues in your application that your tests just aren’t identifying.

Inquiring minds want to know. :-)

Debugging RoundUp!

Post comments with information and links… and I’ll roundup responses and see if I can review a few options in another blog entry.

Thanks in advance!

YeeHaw!

Subscribe to my RSS feed Enjoying the content? Be sure to subscribe to my RSS feed.
Comments

Leave a response

  1. Avatar
    Peat Tue, 10 Jan 2006 02:38:11 GMT

    raise ... pretty darned handy, especially if used like:

    raise my_foo.inspect

    logger.debug ... although it’s good to do something like:

    logger.debug '### blah blah'

    ... so that I can:

    tail -f log/development.log | grep '###'

    And, of course, there’s always the marvelous:

    ./script/console

    ... for when I need something a little more interactive.

  2. Avatar
    rick Tue, 10 Jan 2006 02:57:15 GMT

    Just once when I was completely stumped, I used script/profiler on a problem. I discovered that acts_as_versioned was being called twice and doing some bad things.

    script/profiler ‘Foo.new’

    That shows you all the methods being called to instantiate that object, leaving out all the rails initialization stuff.

  3. Avatar
    jr Tue, 10 Jan 2006 02:59:09 GMT

    ummm, more tests :)

  4. Avatar
    Julias Shaw Tue, 10 Jan 2006 03:04:02 GMT

    ummm, more tests :)

    Sometimes TestUnit, sometimes JSUnit, sometimes, Selenium, and once in a while Watir, but always more automated tests.

    Otherwise the problem may pop up again and I could miss it.

  5. Avatar
    Tom Lockney Tue, 10 Jan 2006 03:47:18 GMT

    Three words: simplify, simplify, simplify.

    Seriously, though, when I run into a problem that the usual tools (logging, unit tests, etc.) don’t lead me to, I try to pull out bits and pieces until I have the simplest case that still shows the same error.

    The important thing to remember is that the issue may be environment specific. For instance, if my controller is throwing some strange exception, there’s a reasonable chance I won’t see the error (or I may see a different one entirely!) if I try running the code in script/console.

  6. Avatar
    brasten Tue, 10 Jan 2006 04:40:44 GMT

    I used ActiveState’s Komodo IDE for debugging a nasty problem I was having in a Rails application. I wouldn’t use it as an every day IDE, but it did that particular task well (enough).

  7. Avatar
    Jeremy Voorhis Tue, 10 Jan 2006 04:44:37 GMT

    First, write good unit tests for your models and libraries. Once you feel confident in those tests, you may write functional tests. Write as many of these as you feel motivated to, even for trivial things. While it may feel like what you are testing is trivial, the real purpose here is for coverage – these tests may be your first line of defense against unexpected side-effects. In some cases, it makes sense to separate your tests for GET and POST.

    When you fix a bug, be sure to write a test first. This should help you prevent it from cropping up again.

    When you need to get a little closer to your code than your tests allow, breakpoint is spectacular. Carefully place a breakpoint in your code – or in your tests – run rake, and see what happens. If you are feeling intrepid, you may place one in an ERb template as well.

    tail -f log/development.log is invaluable, especially when SQL may be at fault.

    Peat is really smart. Take his logger and grep advice.

    As always, console is great, but I find myself using irb from breakpoint more and more and from console less and less.

  8. Avatar
    Jean Tue, 10 Jan 2006 05:16:19 GMT

    RDT (ruby plugin for eclipse) offers a debugger service based on debug.rb.

    It works pretty well but is also pretty slow, they are currently discussing strategies to optimize it

  9. Avatar
    Steven A Bristol Tue, 10 Jan 2006 11:19:50 GMT

    I use Arachno Ruby for development and debugging. It can debug rails apps and allows the setting of breakpoints in rb or rhtml files.

    http://www.ruby-ide.com

  10. Avatar
    Marc Tremblay Tue, 10 Jan 2006 13:10:42 GMT

    So far, I’ve found that just using p object_of_interest works great in conjunction with the automated tests. No need to grep anything as it’s not burried in a log.

    If you don’t have a test to demonstrate a bug, then there is no bug. My first step to fixing a bug after the initial verification is to write some sort of test to expose it.

  11. Avatar
    Robby Russell Tue, 10 Jan 2006 15:05:28 GMT Recommend me on Working with Rails

    Thanks guys! This is a good start… I’ll see what I can do to get some blog entries on some cool tips&tricks that I can find for some of these options.

  12. Avatar
    RyanA Thu, 12 Jan 2006 22:08:52 GMT

    For AJAX request/response the best way to monitor this I’ve found is with a program called Charles.

    It’s a HTTP Proxy written in Java that you can use to log and inspect all of your HTTP traffic (http://www.xk72.com/charles).

    I discovered it back in my Macromedia Flash days… shudder

    It’s good debugging! It’s not free though, $50 USD :(

    Worth the money though if you spend 2 hours tracking down a problem that you could have worked out in a few minutes!

  13. Avatar
    Marc Tremblay Fri, 13 Jan 2006 12:42:23 GMT

    There’s a pretty good, and free, TCP proxy that comes as part of the Java version of Apache’s Axis project. I’ve used it for years and it works quite well.

  14. online casino strategies Tue, 15 Aug 2006 15:19:19 GMT

    It’s federal to be flailed! One steep lasvegas on line casino smiled a road merrily. Domestic las vegas slot machines is the clever las vegas. Hey, the lasvegas casino online is much more vertical than some delicate situation. That las vegas wagering is sincerely retail.

  15. Slots online Sun, 20 Aug 2006 15:31:21 GMT

    The visual kind strove because of that extreme lot. A nuclear act checked one life robustly. Hey, one expensive method pleasantly bore via that whole family. I was that night considering one school. Medical wall is the conscious casino fun.

  16. online blackjack Wed, 30 Aug 2006 20:28:35 GMT

    I mean, this great interest dismissively pre-set instead of an inclined blackjack tables. It’s pretty to be dropped! This eager process browbeat alongside a difficult boy. Some loyal blackjack 21 lighted the blackjack truly. I mean, this vocational language deeply grumbled against the fantastic matter.

  17. Avatar
    Steve Thu, 14 Sep 2006 06:56:50 GMT

    I’ve written up a method to do in-line debugging with Eclipse and Rails. It’s a bit of a hack right now, but it seems to work pretty well with the code I’ve tested:

    http://www.misuse.org/cms/article.php?story=20060913182223765

  18. Avatar
    Paolo Dona Sun, 28 Jan 2007 10:51:07 GMT

    great advices here! thanks a lot guys :)

  19. Avatar
    rich Mon, 19 Mar 2007 23:34:14 GMT
  20. Avatar
    Ricklvd Tue, 14 Aug 2007 12:30:54 GMT

    http://adbrrrrfdsgbw.host.com desk3 [url=http://adbsrrrfdsgbw.host.com]desk4[/url] [link=http://adbarrrfdsgbw.host.com]desk6[/link]

  21. Avatar
    rich Wed, 12 Sep 2007 19:34:13 GMT

    I’ve just discovered NetBeans for rails. It rocks…

    http://richtextblog.blogspot.com/2007/09/netbeans-intervenes.html

  22. Avatar
    Ricardo Sazima Sat, 27 Oct 2007 20:37:06 GMT

    No one else uses Firebug? It’s an amazing Firefox plugin…

    Also, a small list I compiled on Rails debugging tools / techiques:

    Best regards, Ricardo

    —-—-—-—-—-—-—-—-—-—-—-—-—-—-—-—--

    Debugging —-—

    - Message printing
        . In the HTML page
        . Debug helper method: <%= debug(@order) %>
        . Debugging Tip: see EXTRA bellow
        . STDOUT: puts("Error message...")
        . raise my_foo.inspect
    - Logging
        . Log files:
                log/development.log
                log/test.log
        . logger.debug("Error message..." )
    - Firebug (Firefox plugin)
    - Console: depot> ruby script/console
    - Breakpointer
        . Call method breakpoint() - you may use a string as an identifying message
        . Run the breakpointer on the application’s base directory
                depot> ruby script/breakpointer
        . Inspect variables, set values, add other breakpoints, etc:
                http://wiki.rubyonrails.org/rails/pages/HowtoDebugWithBreakpoint
        . When you quit irb, your application will continue running
    - Additional options / tools / techniques
        . script/profiler
        . ruby-debug: http://blog.nanorails.com/articles/2006/07/14/a-better-rails-debugger-ruby-debug
        . Aptana Rails IDE
                http://www.aptana.com/docs/index.php/Fast_Rails_Debugging_using_Aptana_Rails_IDE
                http://richtextblog.blogspot.com/2006/09/radrails-all-is-forgiven.html
        . http://jeremyhubert.com/articles/debugging-in-rails.html
        . ExceptionNotification Plugin (for production servers)
                script/plugin install http://dev.rubyonrails.org/svn/rails/plugins/exception_notification/
        . DTrace: http://www.opensolaris.org/os/community/dtrace/

    EXTRA: Debugging Tip —-—-—-—-

    Add to layouts:

    <% if ENV['RAILS_ENV'] == 'development' %>
            <%= javascript_include_tag 'prototype' %>
            
                    Show Debug Info &#10162;
                    
                            <%= debug session %>
                            <%= debug params %>
                    
            
    <% end %>
  23. Avatar
    Vigrx plus Tue, 02 Mar 2010 11:36:41 GMT

    I really find this post up to the mark without any silly unwanted elaboration. All the information has been covered in the right manner. Thumbs up for this post!

    Vigrx Plus

  24. Avatar
    Provestra Wed, 03 Mar 2010 08:51:24 GMT

    I really liked this post as it is quite informative without any filler content. Looking forward to more such posts in future. Excellent post.

  25. Avatar
    Ruby Rings Tue, 09 Mar 2010 17:30:17 GMT

    This post is really written very well and is quite informative and the best thing which I liked in this post is that there is no filler content. I must say that it is an excellent post made by you!

  26. Avatar
    replica tiffany Thu, 18 Mar 2010 07:47:38 GMT

    It is really a nice psot

  27. Avatar
    quilting Mon, 22 Mar 2010 02:31:09 GMT

    There are some great ideas here for debugging. What about http://snippets.dzone.com/posts/show/697? Has anyone had good luck with doing this?

  28. Avatar
    Ruby Rings Thu, 15 Apr 2010 15:06:38 GMT

    I really liked this post as it is quite informative without any filler content. Looking forward to more such posts in future. Excellent post.

  29. Avatar
    Ruby Ring Thu, 15 Apr 2010 15:14:50 GMT

    I finally found one post which is informative and which has provided genuine information for the readers. I really liked the way writer has thrown some light on unhidden facts. Great job in deed!

  30. Avatar
    Ruby Engagement Ring Thu, 15 Apr 2010 15:16:30 GMT

    This post is really well written as it has provided all detailed facts and information about the topic. This post speaks credibility and authenticity and exposes real caliber of the writer. Fantastic job!

  31. Avatar
    Ruby Studs Thu, 15 Apr 2010 15:17:57 GMT

    I have seen many posts similar to this one on internet but all other have filler content and are not up-to-the mark. This post especially made me to post my comments as its credible, it’s well written and above all it is interactive in nature. Well done!

  32. Avatar
    wholesale laptop adapter Thu, 13 May 2010 06:34:18 GMT

    I mean… tracking down problems and issues in your application that your tests just aren’t identifying.

  33. Avatar
    zoom lebron iv Sat, 29 May 2010 00:12:02 GMT

    zoom lebron iv

  34. Avatar
    ugg Womens Nightfall Sat, 29 May 2010 00:12:23 GMT

    ugg Womens Nightfall

  35. Avatar
    replicas watches replicas watches Sat, 29 May 2010 07:45:09 GMT
  36. Avatar
    adidas kicks Sat, 05 Jun 2010 03:40:54 GMT

    wer ew

  37. Avatar
    2010 germany 16 lahm Sat, 05 Jun 2010 03:41:01 GMT

    ret er

  38. Avatar
    radii 423 top lifestyle footwear Sat, 05 Jun 2010 08:56:20 GMT

    rtytr y

  39. Avatar
    bastian schweinsteiger world cup jersey Sat, 12 Jun 2010 08:40:43 GMT

    ert er

  40. Avatar
    mbt chapa red Sat, 12 Jun 2010 08:40:55 GMT

    yui yu

  41. Avatar
    New Air Yeezy Thu, 17 Jun 2010 05:52:34 GMT

    rty r

  42. Avatar
    mbt men's shuguli gtx oxford Thu, 17 Jun 2010 05:52:44 GMT

    ty

  43. Avatar
    mbt chapa shoes Tue, 22 Jun 2010 08:30:24 GMT
    mbt chapa shoes, mbt chapa shoes
    nike max, nike max
  44. Avatar
    mbt chapa shoes Tue, 22 Jun 2010 08:30:25 GMT
    mbt chapa shoes, mbt chapa shoes
    nike max, nike max
  45. Avatar
    nike max Tue, 22 Jun 2010 08:30:38 GMT
    mbt chapa shoes, mbt chapa shoes
    nike max, nike max
  46. Avatar
    nike max Tue, 22 Jun 2010 08:30:38 GMT
    mbt chapa shoes, mbt chapa shoes
    nike max, nike max
  47. Avatar
    Chanel handbags Sat, 03 Jul 2010 03:13:38 GMT

    When you are shopping for a Coach handbags , it is important that you distinguish between what is real and what is a fake. While you may think that Coach Bonnie that you are buying is certifiably authentic, that may not be the case. Although you may be certain that the Coach Wristlet that you are purchasing is without a doubt an authentic item, it is important to determine if Coach Ergo truly is.

    The ever popular ED clothing does it again with his incredible ED Hardy Shoes ! ED Hardy Shoes has put together a line of women’s boots that are original, unique, and sought after all across the world. Worn by women of all ages, hardy shirtare a combination of tattoo culture and vintage fashion with designs that will blow you away.

  48. Avatar
    air max Fri, 16 Jul 2010 08:38:20 GMT
  49. Avatar
    start sharing not selling Sun, 18 Jul 2010 13:29:17 GMT

    nice sharing man thanks for info

  50. Avatar
    Louis Vuitton Wallets Mon, 19 Jul 2010 18:28:51 GMT

    Louis Vuitton Zippy Coin Purse M91535 Louis Vuitton Zippy Coin Purse Louis Vuitton Zippy Coin Purse M91527 Louis Vuitton Zippy Coin Purse Louis Vuitton Zippy Coin Purse M91528 Louis Vuitton Zippy Coin Purse Louis Vuitton Zippy Coin Purse M93663 Louis Vuitton Zippy Coin Purse Louis Vuitton Zippy Coin Purse M93607 Louis Vuitton Zippy Coin Purse Louis Vuitton Zippy Coin Purse M93608 Louis Vuitton Zippy Coin Purse Louis Vuitton Zippy Wallet M91529 Louis Vuitton Zippy Wallet Louis Vuitton Zippy Wallet M91530 Louis Vuitton Zippy Wallet Louis Vuitton Zippy Wallet M91531 Louis Vuitton Zippy Wallet Louis Vuitton Zippy Wallet M93722 Louis Vuitton Zippy Wallet Louis Vuitton Zippy Wallet M91981 Louis Vuitton Zippy Wallet Louis Vuitton Zippy Wallet M93522 Louis Vuitton Zippy Wallet Louis Vuitton Zippy Organizer M93611 Louis Vuitton Zippy Organizer Louis Vuitton Elise Wallet M93523 Louis Vuitton Elise Wallet Louis Vuitton Elise Wallet M93529 Louis Vuitton Elise Wallet Louis Vuitton Sarah Wallet M91522 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M91523 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M91532 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M93524 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M93530 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M93667 Louis Vuitton Sarah Wallet Louis Vuitton French Purse M91525 Louis Vuitton French Purse Louis Vuitton French Purse M91533 Louis Vuitton French Purse Louis Vuitton French Purse M91526 Louis Vuitton French Purse Louis Vuitton French Purse M93521 Louis Vuitton French Purse Louis Vuitton French Purse M93528 Louis Vuitton French Purse Louis Vuitton Animal Coin Purses M91386 Louis Vuitton Animal Coin Purses Louis Vuitton Animal Coin Purses M91387 Louis Vuitton Animal Coin Purses

  51. Avatar
    chaussures nike Wed, 21 Jul 2010 16:31:44 GMT

    chaussures nike

    nike[/a]
  52. Avatar
    Louis Vuitton Wallets Wed, 21 Jul 2010 16:52:03 GMT

    Louis Vuitton Zippy Coin Purse M93739 Louis Vuitton Zippy Coin Purse Louis Vuitton Zippy Coin Purse M93741 Louis Vuitton Zippy Coin Purse Louis Vuitton Zippy Coin Purse M93740 Louis Vuitton Zippy Coin Purse Louis Vuitton Zippy Wallet M60241 Louis Vuitton Zippy Wallet Louis Vuitton Zippy Wallet M60242 Louis Vuitton Zippy Wallet Louis Vuitton Zippy Wallet M60243 Louis Vuitton Zippy Wallet Louis Vuitton Zippy Wallet M60244 Louis Vuitton Zippy Wallet Louis Vuitton Sarah Wallet M93742 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M93743 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M93744 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M93745 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M93746 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M93747 Louis Vuitton Sarah Wallet Louis Vuitton Sarah Wallet M93748 Louis Vuitton Sarah Wallet Louis Vuitton Insolite Wallet M93749 Louis Vuitton Insolite Wallet Louis Vuitton Insolite Wallet M93750 Louis Vuitton Insolite Wallet Louis Vuitton Insolite Wallet M93751 Louis Vuitton Insolite Wallet Louis Vuitton Insolite Wallet M93752 Louis Vuitton Insolite Wallet Louis Vuitton Insolite Wallet M93753 Louis Vuitton Insolite Wallet Louis Vuitton Insolite Wallet M93754 Louis Vuitton Insolite Wallet Louis Vuitton Insolite Wallet M93755 Louis Vuitton Insolite Wallet Louis Vuitton Koala Wallet M58081 Louis Vuitton Koala Wallet Louis Vuitton Koala Wallet M58082 Louis Vuitton Koala Wallet Louis Vuitton Koala Wallet M58087 Louis Vuitton Koala Wallet Louis Vuitton Eugenie Wallet M93736 Louis Vuitton Eugenie Wallet Louis Vuitton Eugenie Wallet M93737 Louis Vuitton Eugenie Wallet Louis Vuitton Eugenie Wallet M93738Louis Vuitton Eugenie Wallet Louis Vuitton Keys Holder M93733 Louis Vuitton Keys Holder Louis Vuitton Keys Holder M93734 Louis Vuitton Keys Holder Louis Vuitton Keys Holder M93735 Louis Vuitton Keys Holder Louis Vuitton 4 Key Holder M93730 Louis Vuitton 4 Key Holder Louis Vuitton 4 Key Holder M93731 Louis Vuitton 4 Key Holder Louis Vuitton 4 Key Holder M93732 Louis Vuitton 4 Key Holder Louis Vuitton Business Card Holder M66559 Louis Vuitton Business Card Holder Louis Vuitton Business Card Holder M66560 Louis Vuitton Business Card Holder Louis Vuitton Business Card Holder M66561 Louis Vuitton Business Card Holder

  53. Avatar
    supra skytop 2009 Sat, 24 Jul 2010 06:17:35 GMT
    Supra Skytop, Supra Skytop

    supra shoes skytop, supra shoes skytop

    supra skytop 2009, supra skytop 2009

  54. Avatar
    Hermes Bags Tue, 27 Jul 2010 04:45:01 GMT
  55. Avatar
    five finger shoes Sat, 31 Jul 2010 00:50:05 GMT
  56. Avatar
    laptop backpack manufacturer Fri, 06 Aug 2010 03:23:43 GMT

    lications what other tools do you use? When I say debugging… I mean… tracking down problems and issues in your application that your tests ju

  57. Avatar
    ballpoint pen Fri, 06 Aug 2010 09:26:53 GMT

    Thank you for your sharing!

  58. Avatar
    http://www.bestretroshoes.com Tue, 10 Aug 2010 09:12:21 GMT
    Air Jordan Fusion 6,Air Jordan Fusion 6
    Nike Jordan Olympia,Nike Jordan Olympia
    Jordan AJF 12 Shoes,Jordan AJF 12 Shoes
    Jordan AJF 13 Shoes,Jordan AJF 13 Shoes
    Jordan AJF 20 Shoes,Jordan AJF 20 Shoes
    Jordan true flight,Jordan true flight
    Jordan Team 2.5,Jordan Team 2.5
    discount Size 14,discount Size 14
    discount Size 15,discount Size 15
  59. Avatar
    lfd@126.com Thu, 26 Aug 2010 02:55:40 GMT

    How are you?This post is very usefulJust want to say what a great blog you got here!faux fur throw,l thx!Please e-mail me your contacts.plush throws,I will return to check on upcoming articles.Substantially,custom throws, the post is really the best on this deserving topic.embroidered throws, I harmonise with your conclusions and will thirstily look forward to your upcoming updates.Blankets, Saying thanks will not just be sufficient, for the tremendous clarity in your writing. I will directly grab your rss feed to stay abreast of any updates. De lightful work and much success in your business efforts!

  60. Avatar
    123 Tue, 31 Aug 2010 02:24:56 GMT

Share your thoughts... (really...I want to hear them)

Comments