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 9121279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:49:30+00:00 2026-06-17T05:49:30+00:00

I get this error about my routes file SystemStackError (stack level too deep): actionpack

  • 0

I get this error about my routes file

SystemStackError (stack level too deep):
  actionpack (3.2.8) lib/action_dispatch/middleware/reloader.rb:70


  Rendered /Users/duy/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms)
  Rendered /Users/duy/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.3ms)
  Rendered /Users/duy/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (19.9ms)

I could isolate the problematic code but don’t understand what’s creating the infinite loop:

  devise_for :users, :controllers => { :registrations => "registrations", :sessions => "sessions", :omniauth_callbacks => "users/omniauth_callbacks" }
  devise_scope :user do
    match '/sessions/simulate_user/:id' => 'sessions#simulate_user', :as => :simulate_user_sessions
    match '/sessions/leave_simulation_mode' => 'sessions#leave_simulation_mode', :as => :leave_simulation_mode_sessions
    get "user_confirmation", :to => "devise/confirmations#create"
    get "after_confirmation", :to => "challenges#index"
  end

Any help would be greatly appreciated!

EDIT:

class SessionsController < Devise::SessionsController

  def new

    @after_sign_in_page = params[:after_sign_in_page] if params[:after_sign_in_page]
    super
  end

  def create
    params[:user][:email].downcase!
    super
  end

  def simulate_user
    if can? :simulate_user, User
      admin = current_user.id
      sign_out
      @user = User.find(params[:id])
      if sign_in @user
        session[:simulation_for] = admin
        redirect_to request.referer
      else
        flash[:notice] = "Something went wrong"
        redirect_to action: "leave_simulation_mode"
      end
    end
  end

  def leave_simulation_mode
    @user = User.find(session[:simulation_for])
    sign_out
    if sign_in @user
      session[:simulation_for] = nil
    else
      flash[:notice] = "something went wrong..."
    end
    redirect_to request.referer
  end

end
class ChallengesController < ApplicationController
      def index
        params[:format] = "html" unless params[:subaction].nil?
        @video = true unless user_signed_in?
        if current_user
          @current_page = params[:page] ? params[:page].to_i : 1
          @columns = params[:cols] ? params[:cols] : 2
          @keyword = params[:keyword]
          @search = true if params[:search] == "1"
          @challenges = Challenge.is_open.where(id: current_user.challenges.filtered(params[:keyword],params[:user],params[:expertize]).collect(&:root_id).uniq)
          logger.debug "Challenges found: #{@challenges.count}"
          @users = User.scoped
          @expertizes = Expertize.all
        end

        respond_to do |format|
          format.html {
            if current_user
              if current_user.challenges.waiting_for_approval.count == 1 and @challenges.count == 1
                redirect_to challenge_path(current_user.challenges.waiting_for_approval.first, subaction: "description")
                return
                logger.debug "REdirect called"
              else
                @challenges = @challenges.page(1).per(@current_page.to_i * 10).order('children_count+tasks_count desc')
              end
            end
            render
            }
          format.json { render json: @challenges }
          format.js {
            @challenges = @challenges.page(@current_page).per(10).order('children_count+tasks_count desc')
            render
          }
        end
      end
end

Also, I forgot to mention that when I restart the local server, it works fine. Every time I change my routes.rb file, I get this error. Then I have to restart the Thin server, then I can work further on…

EDIT 2:

rake route output: https://www.dropbox.com/s/knmkk1f54vx47yj/rake%20routes.rtf

  • 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-06-17T05:49:32+00:00Added an answer on June 17, 2026 at 5:49 am

    I have a same problem with you. This must be a issue caused by some gems.

    Like I use “devise_invitable” with “devise”. then every time I modified route file in development environment. it will raise an “stack too deep” error from “lib/action_dispatch/middleware/reloader.rb”.

    After reading your post. I try to comment devise_for :users.
    Reload routes is ok.

    Then I try to remove “devise_invitable” from Gemfile.

    After made changes. it doesn’t raise error.
    This happend after I use Rails 3.2.9.
    I have another project < Rails 3.2.9, two gems works correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error about casting from type A to type B because the
I get a compile error, which I'm slightly confused about. This is on VS2003.
I have this code in my routes.db file: resources :users do member do get
rb file code SampleApp::Application.routes.draw do get static_pages/home match '/help' to:'static_pages#help' match '/about' to:'static_pages#about' match
I get this error while accessing a php script: W/System.err: Error reading from ./org/apache/harmony/awt/www/content/text/html.class
I get this error when i try to upload an image: OSError at /upload/
I get this error on my Ice Cream Sandwich (Android 4.0) device and emulator.
I get this error when I run the code below. I have normally used
I get this error when I use simplejson from django.utils in google app engine
I get this error in my app { error: { message: Missing client_id parameter.,

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.