Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6544695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:29:47+00:00 2026-05-25T11:29:47+00:00

I’ve been coding in Ruby/Rails for almost 9 months now, having spent years before

  • 0

I’ve been coding in Ruby/Rails for almost 9 months now, having spent years before that in Python.

While I’m really enjoying Rails, there’s one area where I often find myself frustrated: chasing down stubborn bugs. In other languages I can almost always track down difficulties without too much trouble, but when I hit a wall debugging rails, I tend to really hit a wall. I guess what I’m asking is: what strategies do advanced rails users employ to track down more stubborn errors?

At the moment my approach is usually:

  1. Examine the stack trace (most simple bugs solved here)

  2. Run debugger/pry/console & examine the environment, pace through each step if necessary

  3. Google it

  4. Post on stack overflow/github issues

  5. Procrastinate and/or swear profusely

If any advanced rails-ers would share their strategy for chasing down more stubborn bugs, I’d be really appreciative. In short, what do yo do when trace/debugger don’t offer any clues?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:29:48+00:00Added an answer on May 25, 2026 at 11:29 am

    Being with Rails mere 5 years, I do not consider myself an advanced Railser, but nevertheless I’ll happily share my knowledge. 🙂

    The main thing when dealing with any (except some very, very trivial ones) is to write a test for this bug.

    A few times it happened that I solved the bug at this stage – for example when the bug was related to the automatic class reloading, which is active in development, and turned off in test mode.

    Then I usually just place some logger.debug statements with a lot of inspect and caller(0).join("\n\t") in it. Then I very carefully examine the log file.

    Because the ‘test.log’ can have a few hundreds megabytes, I always remember to zero it before I run my test. Also I usually run just one test method at the time, because the output would be unreadable otherwise.

    I do not use a dedicated debugger. In some old version of ruby the debugger stopped working, I learned to live without it, and never looked back.


    A few utilities which may be useful:

    A function defined in my ~/.bashrc, which lets me to invoke a single test method (or a group of methods):

    $ testuj test/unit/user_test.rb -n test_name_validations
    $ testuj test/unit/user_test.rb -n /_name_/
    
    function testuj () {
      if [ -n "${BUNDLE_GEMFILE}" ]
      then
        # This is a Rails3 project - it is run by `bundle exec`
        ruby -I"lib:test" "$@"
      else
        # This is a Rails1 project. No bundler.
        ruby -e 'ARGV.each { |f| load f unless f =~ /^-/ ; break if f == "-n" }' "$@"
      fi
    }
    

    And this method helps me with logging and checking the timing of some steps:

    Object.module_eval do
      def czekpoint(note = nil)
        n = Time.now
        $czekpoint_previous ||= n
        $czekpoint_number ||= 0
        $czekpoint_number += 1
        t = n - $czekpoint_previous
        msg = "CZEKPOINT: %2d  %8.6f  %s %s" % [$czekpoint_number, t, caller.first.to_s.in_yellow, note.to_s.in_red]
        Rails.logger.debug msg # In older Rails it was RAILS_DEFAULT_LOGGER
        STDERR.puts msg
        $czekpoint_previous = n
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I need a function that will clean a strings' special characters. I do NOT
I'm having trouble keeping the paragraph square between the quote marks. In firefox the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.