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

  • SEARCH
  • Home
  • 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 5970143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:19:55+00:00 2026-05-22T20:19:55+00:00

Say I have a loop in my code that calls the rails debugger a

  • 0

Say I have a loop in my code that calls the rails debugger a few times

def show
    animals = ['dog', 'cat', 'owl', 'tiger']
    for animal in animals
    debugger
    # do something else
end

Assuming I started my server with the --debugger option, when this page is viewed, the debugger is going to stop for every run of the loop.

I can type cont every time it stops so the request continues, but that’s tedious, especially if we’re not talking about it showing up 4 times as in this example, but 400.
Is there a way to let the debugger continue without pausing at each point of the loop?

My currently workaround is restarting the server, but that’s time consuming.

  • 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-22T20:19:56+00:00Added an answer on May 22, 2026 at 8:19 pm

    Just put conditions on the debugger statement so that it stops only when you want it to, e.g.:

    debugger if animal == 'tiger'
    

    or if, say, you want to examine the code only on loop 384:

    animals.each_with_index do |animal, i|
      debugger if i == 384
      # do something
    end
    

    or put in a variable that will let you continue ad hoc:

    continue_debugger = false
    animals.each do |animal|
      debugger unless continue_debugger
      # in the debugger type `p continue_debugger = true` then `c` when done
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a loop of objects (style.cover.pic) in a DIV .style_image <div class=style_image>
Lets say I have a loop in Bash: for foo in `some-command` do do-something
Say I have the following loop: i = 0 l = [0, 1, 2,
I have some code that queries Active Directory to verify user existence. I am
I have a bit of code that basically displays the last x (variable, but
I have a class that contains a dynamically allocated array, say class A {
Let's say I have some code like this in AS3 for(...) thing = new
Say you have a method that could potentially get stuck in an endless method-call
I have a matrix (call it X ) that is initialized to say zero(3)
I have an AJAX Function that calls a PHP Script and displays the result

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.