title: Rails projects keep breaking. Latest error: missing :controller key
body: <p>I'm fairly new to ROR, and I have been trying to develop a rails project for a while now, but every time I start one, it eventually 'breaks' and gives me an error message whenever I enter any command, even though the commands worked before. The latest error is extremely lengthy, so I'll include it at the end. My question is, is it possible that my computer itself is somehow faulty and I should just get a new one? One time, no matter what I typed in, I would get back a "user method undefined" error, and even an experienced rails programmer I showed it to had no idea why. I can't find anything on stackoverflow either. I develop every project I start in the exact same way; I type everything the same, in the exact same order; but they break at different points throughout the development. Last time, it broke after I generated a new controller by entering:</p>
  
  <p>"rails generate controller StaticPages home --without production".</p>
  
  <p>The controller was generated normally, but after that, anything I type results in this error:</p>
  
  <pre><code>    zoltan@zoltan-VPCYB3V1E:~/website$ rails c
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:230:in `default_controller_and_action': Missing :controller key on routes definition, please check your routes. (ArgumentError)
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:116:in `normalize_options!'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:64:in `initialize'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1476:in `new'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1476:in `add_route'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1455:in `decomposed_match'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1436:in `block in match'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1427:in `each'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1427:in `match'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:620:in `map_method'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:581:in `get'
      from /home/zoltan/website/config/routes.rb:3:in `block in &lt;top (required)&gt;'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/route_set.rb:337:in `instance_exec'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/route_set.rb:337:in `eval_block'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/route_set.rb:315:in `draw'
      from /home/zoltan/website/config/routes.rb:1:in `&lt;top (required)&gt;'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:223:in `load'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:223:in `block in load'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:223:in `load'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:40:in `each'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:40:in `load_paths'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:16:in `reload!'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:26:in `block in updater'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/file_update_checker.rb:75:in `call'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/file_update_checker.rb:75:in `execute'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:27:in `updater'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/finisher.rb:69:in `block in &lt;module:Finisher&gt;'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `instance_exec'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `run'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:55:in `block in run_initializers'
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:180:in `each'
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:54:in `run_initializers'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application.rb:215:in `initialize!'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
      from /home/zoltan/website/config/environment.rb:5:in `&lt;top (required)&gt;'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application.rb:189:in `require'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application.rb:189:in `require_environment!'
      from /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/commands.rb:61:in `&lt;top (required)&gt;'
      from bin/rails:4:in `require'
      from bin/rails:4:in `&lt;main&gt;'
  </code></pre>
  
  <p>Yet another time, it would break after setting my secret-key, and I would always get this error:</p>
  
  <pre><code>    zoltan@zoltan-VPCYB3V1E:~/website$ rails generate controller StaticPages home --no-test-framework
      /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- active_support (LoadError)
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /usr/lib/ruby/vendor_ruby/railties/lib/rails_generator.rb:30:in `&lt;top (required)&gt;'
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /home/zoltan/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      from /usr/lib/ruby/vendor_ruby/railties/bin/rails:16:in `&lt;main&gt;'
  </code></pre>
  
  <p>Error message from "rake routes":</p>
  
  <pre><code>    zoltan@zoltan-VPCYB3V1E:~/website$ rake routes
      rake aborted!
      ArgumentError: Missing :controller key on routes definition, please check your routes.
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:230:in `default_controller_and_action'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:116:in `normalize_options!'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:64:in `initialize'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib        /action_dispatch/routing/mapper.rb:1476:in `new'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1476:in `add_route'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1455:in `decomposed_match'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1436:in `block in match'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1427:in `each'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:1427:in `match'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:620:in `map_method'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/mapper.rb:581:in `get'
      /home/zoltan/website/config/routes.rb:3:in `block in &lt;top (required)&gt;'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/route_set.rb:337:in `instance_exec'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/route_set.rb:337:in `eval_block'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/actionpack-4.0.8/lib/action_dispatch/routing/route_set.rb:315:in `draw'
      /home/zoltan/website/config/routes.rb:1:in `&lt;top (required)&gt;'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:223:in `load'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:223:in `block in load'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:223:in `load'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:40:in `each'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails        /application/routes_reloader.rb:40:in `load_paths'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:16:in `reload!'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:26:in `block in updater'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/file_update_checker.rb:75:in `call'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/file_update_checker.rb:75:in `execute'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:27:in `updater'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application/finisher.rb:69:in `block in &lt;module:Finisher&gt;'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `instance_exec'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `run'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:55:in `block in run_initializers'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:54:in `run_initializers'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application.rb:215:in `initialize!'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
      /home/zoltan/website/config/environment.rb:5:in `&lt;top (required)&gt;'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application.rb:189:in `require_environment!'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application.rb:250:in `block in run_tasks_blocks'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `eval'
      /home/zoltan/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
      Tasks: TOP =&gt; routes =&gt; environment
      (See full trace by running task with --trace)
  </code></pre>
  
  <p>This is the routes file that was generated:</p>
  
  <pre><code>Website::Application.routes.draw do
    get "static_pages/home"
    # The priority is based upon order of creation: first created -&gt; highest priority.
    # See how all your routes lay out with "rake routes".
  
    # You can have the root of your site routed with "root"
    # root 'welcome#index'
  
    # Example of regular route:
    #   get 'products/:id' =&gt; 'catalog#view'
  
    # Example of named route that can be invoked with purchase_url(id: product.id)
    #   get 'products/:id/purchase' =&gt; 'catalog#purchase', as: :purchase
  
    # Example resource route (maps HTTP verbs to controller actions automatically):
    #   resources :products
  
    # Example resource route with options:
    #   resources :products do
    #     member do
    #       get 'short'
    #       post 'toggle'
    #     end
    #
    #     collection do
    #       get 'sold'
    #     end
    #   end
  
    # Example resource route with sub-resources:
    #   resources :products do
    #     resources :comments, :sales
    #     resource :seller
    #   end
  
    # Example resource route with more complex sub-resources:
    #   resources :products do
    #     resources :comments
    #     resources :sales do
    #       get 'recent', on: :collection
    #     end
    #   end
  
    # Example resource route with concerns:
    #   concern :toggleable do
    #     post 'toggle'
    #   end
    #   resources :posts, concerns: :toggleable
    #   resources :photos, concerns: :toggleable
  
    # Example resource route within a namespace:
    #   namespace :admin do
    #     # Directs /admin/products/* to Admin::ProductsController
    #     # (app/controllers/admin/products_controller.rb)
    #     resources :products
    #   end
  end
  </code></pre>
  
  <p>Are these all just unrelated errors with solutions, or is something really messed up? What's really worrying to me is that I do literally the same exact thing every time, but it acts different every time. I don't know what to do anymore.</p>