1

実行しているアプリケーションのCRUDを追加しましたが、「rails」を使用すると、次のように表示されます。

=> Booting WEBrick

=> Rails 3.2.8 application starting in development on http:/localhost:3000

=> Call with -d to detach


=> Ctrl-C to shutdown server

Exiting

/usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-

3.2.8/lib/action_dispatch/routing/mapper.rb:185:in `default_controller_and_action': missing 
:action (ArgumentError)
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-
3.2.8/lib/action_dispatch/routing/mapper.rb:78:in `normalize_options!'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-
3.2.8/lib/action_dispatch/routing/mapper.rb:61:in `initialize'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-
3.2.8/lib/action_dispatch/routing/mapper.rb:1304:in `new'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-
3.2.8/lib/action_dispatch/routing/mapper.rb:1304:in `add_route'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-
3.2.8/lib/action_dispatch/routing/mapper.rb:1284:in `decomposed_match'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-
3.2.8/lib/action_dispatch/routing/mapper.rb:1270:in `block in match'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1270:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1270:in `match'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:507:in `map_method'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:489:in `put'
    from /Users/GooComedy/Host/Ruby-On-Rails/blog/config/routes.rb:8:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-

3.2.8/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-

3.2.8/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/actionpack-

3.2.8/lib/action_dispatch/routing/route_set.rb:260:in `draw'
    from /Users/GooComedy/Host/Ruby-On-Rails/blog/config/routes.rb:1:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-

3.2.8/lib/active_support/dependencies.rb:245:in `load'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-

3.2.8/lib/active_support/dependencies.rb:245:in `block in load'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-

3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-

3.2.8/lib/active_support/dependencies.rb:245:in `load'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/application/routes_reloader.rb:40:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/application/routes_reloader.rb:40:in `load_paths'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/application/routes_reloader.rb:16:in `reload!'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/application/routes_reloader.rb:26:in `block in updater'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-

3.2.8/lib/active_support/file_update_checker.rb:78:in `call'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activesupport-

3.2.8/lib/active_support/file_update_checker.rb:78:in `execute'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/application/routes_reloader.rb:27:in `updater'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

 3.2.8/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/initializable.rb:30:in `run'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-  

3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-  

3.2.8/lib/rails/initializable.rb:54:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-  

3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/application.rb:136:in `initialize!'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-

3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/GooComedy/Host/Ruby-On-Rails/blog/config/environment.rb:5:in `<top 

(required)>'
    from /Users/GooComedy/Host/Ruby-On-Rails/blog/config.ru:4:in `require'
    from /Users/GooComedy/Host/Ruby-On-Rails/blog/config.ru:4:in `block in <main>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in 


`instance_eval'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in 

`initialize'
    from /Users/GooComedy/Host/Ruby-On-Rails/blog/config.ru:1:in `new'
    from /Users/GooComedy/Host/Ruby-On-Rails/blog/config.ru:1:in `<main>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:40:in 

`eval'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:40:in 

parse_file'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:200:in 

`app'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands/server.rb:46:in `app'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:301:in 
`wrapped_app'

    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-
3.2.8/lib/rails/commands/server.rb:70:in `start'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-
3.2.8/lib/rails/commands.rb:55:in `block in <top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-
3.2.8/lib/rails/commands.rb:50:in `tap'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-
3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
4

1 に答える 1

1

Routes.rbファイルで、ルートコントローラーとアクションをフォームに追加する必要があります

root :to => "controller_name#action_name"
于 2012-12-02T05:22:19.727 に答える