Rails服务器在启动时退出。 (Rails 4.0.2)

时间:2014-03-10 07:56:20

标签: ruby-on-rails

Rails服务器突然在启动时保持退出状态。虽然它在不久前完美运作。从那以后我没有调整任何东西。

=> Booting WEBrick
=> Rails 4.0.2 application starting in development on http: //0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server

Exiting

/home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:229:in `default_controller_and_action': missing :controller (ArgumentError)
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:116:in `normalize_options!'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:64:in `initialize'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1443:in `new'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1443:in `add_route'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1422:in `decomposed_match'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1403:in `block in match'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1394:in `each'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1394:in `match'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:601:in `map_method'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:570:in `post'
    from /home/kavya/lms/config/routes.rb:11:in `block in <top (required)>'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `instance_exec'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `eval_block'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:319:in `draw'
    from /home/kavya/lms/config/routes.rb:1:in `<top (required)>'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `each'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:in `call'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:in `execute'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:27:in `updater'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /home/kavya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/kavya/lms/config/environment.rb:5:in `<top (required)>'
    from /home/kavya/lms/config.ru:3:in `require'
    from /home/kavya/lms/config.ru:3:in `block in <main>'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from /home/kavya/lms/config.ru:in `new'
    from /home/kavya/lms/config.ru:in `<main>'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:314:in     `wrapped_app'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
    from /home/kavya/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

1 个答案:

答案 0 :(得分:2)

你可以参考这里..

Why is my development server not loading? default_controller_and_action': missing :action (ArgumentError)

这是因为您的应用程序中config/routes.rb下的语法问题:

检查您可能会发现的路线,例如在以下路线中定义controller#action时。

语法不应该像:

root :to => 'home/index'

语法应该是:

root :to => 'home#index'