0

标题里差不多。我和其他人一起做一个项目,然后将 git repo 克隆到我的计算机上,添加了一个新控制器,然后想得更好,于是跑了:

rails destroy controller requests

(requests 是控制器的名称),只是得到这个无穷无尽的错误信息:

/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>'

它以前工作过,所以发生了什么?我可能需要重新安装被覆盖的东西吗?

另外,有什么想法为什么在粘贴我正在学习的rails教程的所有内容时出错?我不记得该文本在我的文件中的任何位置?

谢谢

4

1 回答 1

3

看来您的路线可能有错误。您的 routes.rb 中是否添加了任何新路线?如果是这样,请尝试将它们注释掉,然后运行您的命令。

于 2012-08-23T23:39:08.703 回答