2014-03-14 52 views
0

有點新的軌道,但我產生了一些控制器,我做了一個,然後去另做它吐出一個錯誤:的Rails了產生控制器突然決定停止工作

c:\row\dev\a>rails generate controller Person name:string 
C:/row/ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/rou 
ting/mapper.rb:229:in `default_controller_and_action': missing :controller (Argu 
mentError) 

我試過的RubyMine只是看,它幾乎只是做了同樣的事情,它輸出的完整清單如下。我從來沒有決定停止生成這樣的控制器,並且我在路由文件中添加了一些東西,因爲我看到一個鏈接,表示路由文件可能需要root來:'controller#action',儘管我從來沒有將其包含在路由文件中以生成控制器之前,但是沒有解決它。這是我在網上可以找到的唯一類似問題。有什麼想法嗎?

C:\row\Ruby200\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/row/dev/a/bin/rails generate controller person name:string -s 
C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:229:in `default_controller_and_action': missing :controller (ArgumentError) 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:116:in `normalize_options!' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:64:in `initialize' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1443:in `new' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1443:in `add_route' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1422:in `decomposed_match' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1403:in `block in match' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1394:in `each' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1394:in `match' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:601:in `map_method' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:562:in `get' 
    from C:/row/dev/a/config/routes.rb:2:in `block in <top (required)>' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `instance_exec' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `eval_block' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:319:in `draw' 
    from C:/row/dev/a/config/routes.rb:1:in `<top (required)>' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `each' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `load_paths' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:16:in `reload!' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:26:in `block in updater' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:in `call' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:in `execute' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:27:in `updater' 
    from C:131071:in `execute_if_updated' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers' 
    from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each' 
    from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component' 
    from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from' 
    from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component' 
    from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each' 
    from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component' 
    from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing' 
    from C:/row/dev/a/config/environment.rb:5:in `<top (required)>' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!' 
    from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:44:in `<top (required)>' 
    from C:/row/dev/a/bin/rails:4:in `require' 
    from C:/row/dev/a/bin/rails:4:in `<top (required)>' 
    from -e:1:in `load' 
    from -e:1:in `<main>' 

Process finished with exit code 1 

回答

2

用於生成你的方法名指定的控制器不變量

rails generate controller Person index show 

我希望你明白,它爲你工作。

謝謝。

+0

即使輸入正確,仍然會發生同樣的錯誤:D – ryancroker

+0

閱讀http://www.jetbrains.com/ruby/webhelp/create-and-run-your-first-project.html它將指導您。 –

+0

不適合它只是爲了它,但它不是一個語法的東西,我只是要重新安裝rubymine,我可以在一個新的軌道應用程序沒有加載到rubymine中執行相同的命令,它工作正常,但該項目現在已被竊聽,它不會生成任何控制器。 – ryancroker