title: Circular dependency detected while autoloading constant when loading constant
body: <p>First of all: I googled and used the search here and found answers to the same error but on different setups. Maybe I broke sth different ;)</p>
  
  <p>Error:</p>
  
  <pre><code>RuntimeError at /admin/users
  Circular dependency detected while autoloading constant Admin::UsersController
  </code></pre>
  
  <p>The structure is:</p>
  
  <pre><code>App =&gt; controllers =&gt; admin =&gt; users_controller.rb
  </code></pre>
  
  <p>Routes:</p>
  
  <pre><code>namespace :admin do
    resources :stuff
    resources :users
  end
  </code></pre>
  
  <p>Users controller:</p>
  
  <pre><code>class UsersController &lt; Admin::BaseController
    def new
      #code
    end
  
    def create
      #code
    end
  
    def index
      #code
    end
  
    private
  
    def user_params
     #code
    end
  end
  </code></pre>
  
  <p>Admin base controller</p>
  
  <pre><code>class Admin::BaseController &lt; ApplicationController
    layout 'admin'
    before_filter :require_login
  end
  </code></pre>
  
  <p>Using: Rails 4.1.4, Ruby 2.1.2
  What did I do wrong here?</p>
  
  <p>Thanks for your help!</p>
  
  <p>Edit:</p>
  
  <p>development.rb</p>
  
  <pre><code>Rails.application.configure do
   config.cache_classes = false
   config.eager_load = false
   config.consider_all_requests_local       = true
   config.action_controller.perform_caching = false
   config.action_mailer.raise_delivery_errors = false
   config.active_support.deprecation = :log
   config.active_record.migration_error = :page_load
   config.assets.debug = true
   config.assets.raise_runtime_errors = true
  end
  </code></pre>