archives
- November 2008 (2)
- October 2008 (4)
- September 2008 (2)
- August 2008 (4)
- July 2008 (10)
- June 2008 (5)
- May 2008 (5)
- April 2008 (10)
- March 2008 (13)
- February 2008 (3)
- January 2008 (7)
- December 2007 (7)
- November 2007 (9)
- October 2007 (10)
- September 2007 (1)
blogroll
This post is for those that are new to Ruby on Rails, or those that have not spent the time learning the various debugging techniques. The objective is to get you quickly up to speed on how to debug your Ruby on Rails application.
Subversion
Version control is essential, along with the practice of frequent commits with meaningful comments. Even when its just a one-person team. That way, any time you get stuck, you can execute a diff and easily see what was changed before you, or the person you outsourced to, messed everything up.
If you will host subversion locally on your machine, here is what you need to get started. Then, take a look at this to learn about usage and management. If you prefer to let someone else host subversion, there are many service providers that will do that for you. Our team uses DreamHost. We set up the repository ourselves with no problem.
In Windows, check out Tortoise SVN, and if you use Eclipse or Aptana, check out the subClipse plugin.
Unit Tests
When you are in an environment where you are rapidly introducing features, it becomes easier to break parts of the code and not realize it until it is too late. Unit tests help minimize this problem by alerting you when a part of your code does not perform as anticipated.
Ruby on Rails includes unit test functionality out of the box, which you should take advantage of from day one. Here is a great resource to get started. If you are new to the concept, take a look here and here.
Exception Handling
If there exists areas of your code where, if broken, cause natural disasters (thats an exaggeration of course, but I wanted to emphasize that this technique is to be used in exceptional cases), then you will want to employ exception handlers. Take a look here for a quick and easy example.
Logging
When I encounter errors, a frequent resource of finding the root cause are the web server logs. Learn the location of these logs in your development environment. Check these resources for detailed information about the log locations and contents for Apache, Mongrel (see the “super debugging with rails” section) and LightHTTP (see the “where things will end up” section).
Ruby on Rails uses Ruby’s standard logger for easy logging capabilities. Here is a great starting point.
Breakpoints
Sometimes you will find it useful to cause a break to happen while running your code so that you can get a snapshot of the state. Ruby Debug allows you to easily utilize breakpoints while debugging.
Whats your favorite Ruby on Rails debug method?
about
Find out more about the author here.
categories
- Blogging (1)
- Business (38)
- Design (1)
- Django (1)
- FireFox 3 (1)
- General (4)
- Holiday (3)
- Life Hacks (21)
- Marketing (6)
- offbeat (3)
- Personal Development (8)
- Podcasting (1)
- Productivity (4)
- Programming (12)
- Python (1)
- Reviews (2)
- Sales (5)
- Social Networking (8)
- Symfony (1)
- Ubuntu (7)
- Video (3)
- Windows Vista (1)
- Windows XP (1)
- xv6800 (1)
members
most commented post
- » Managing Your Life With GTD, Online Tools and a File Cabinet - 19
- » How To Download Ustream.tv Videos - 12
- » Plurk Unleashed! - 12
- » Using The Web To Save on Holiday Gifts - 11
- » What Online Social Media Networks Do You Participate In? - 10
- » 19 Secrets From LA's Top SEO Firm - 10
- » The Story Behind iPhone.com - 10
- » Get Symfony Installed in 20 Minutes on Vista - 9
- » CSS Equivalent of Prototype? - 7
- » Thoughts are Things - 7
recent entries
- Using The Web To Save on Holiday Gifts
- GPS Nirvana with the Verizon xv6800 Running Windows Mobile 6.1
- Happy Holloween! Enjoy the Evil Pumpkin!
- Enterprise 2.0: Changing Models for Organization
- Digital Writing: Any Paper, Anywhere
- Emergency Economic Stabilization Act of 2008 - Talking Points
- How to Promote a Local Event
- BaseCamp Just Became Much More Usable
- To Google: Apology Accepted
- A Ten Point Formula for Success by President Lyndon Johnson
recent comments
- BeasMom: Awesome collection - thanks! Please add the gift of TIME to Group Gifting. Perfect for elderly relatives...
- Exquipass: As per my opinion, we should use complex and different passwords for all accounts and then use a safe...
- kizzy: Thanks for this great roundup. I’ve found that PriceGrabber.com is invaluable - more so now than ever,...
- Vijay: Very useful and nice information. It really helps me to buy gifts at cheaper prices and i have saved lot of...
- lee: with internet access so reaily available these days Black Friday is a thing of the past for me. I love cyber...
Wordpress theme by Wordpress Themes & made free by Internet Marketing Center
Copyright 2008, ThinkingSerious.com

October 26 2007
Great article Think. Thanks for the post.