ruby-on-railsdestroyrailtie

Rails destroy controller doesn't work


Pretty much there in the title. I worked on a project with someone else, then cloned the git repo to my computer, added a new controller, and then thought better so ran:

rails destroy controller requests

(requests is the name of the controller), only to get this endless error message:

/Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:181:in `default_controller_and_action': missing :controller (ArgumentError)
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:78:in `normalize_options!'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:61:in `initialize'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1304:in `new'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1304:in `add_route'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1284:in `decomposed_match'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1270:in `block in match'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1270:in `each'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1270:in `match'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:507:in `map_method'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:469:in `get'
    from /Users/sashafklein/rails_projects/meatup/config/routes.rb:3:in `block in <top (required)>'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:260:in `draw'
    from /Users/sashafklein/rails_projects/meatup/config/routes.rb:1:in `<top (required)>'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `block in load'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:40:in `each'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:40:in `load_paths'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:16:in `reload!'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:26:in `block in updater'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `call'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `execute'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:27:in `updater'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/sashafklein/rails_projects/meatup/config/environment.rb:5:in `<top (required)>'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application.rb:103:in `require'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application.rb:103:in `require_environment!'
    from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/commands.rb:25:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

It's worked before, so what's happening? Might I need to reinstall something that got overwritten?

Also, any ideas why on earth is the error pasting all that stuff about the rails tutorial I'm taking? I don't remember that text being anywhere in my files?

Thanks


Solution

  • It seems like you might have an error with your routes. Did any new routes get added to your routes.rb? If so, try commenting them out and then running your command.