我正进入(状态
$ rake routes
rake aborted!
ArgumentError: Missing :action key on routes definition, please check your routes.
/usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-4.1.5/lib/action_dispatch/routing/mapper.rb:243:in `default_controller_and_action'
/usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-4.1.5/lib/action_dispatch/routing/mapper.rb:117:in `normalize_options!'
/usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-4.1.5/lib/action_dispatch/routing/mapper.rb:65:in `initialize'
/usr/local/rvm/gems/ruby-2.1.2/gems/actionpack-4.1.5/lib/action_dispatch/routing/mapper.rb:1487:in `new'
/usr/local/r................
这是我的Routes.rb
Rails.application.routes.draw do
get 'script/index'
get 'landing/index'
root 'landing/index'
end
是什么原因引起的问题以及如何解决。
最佳答案
The Rails router recognizes URLs and dispatches them to a controller's action.错误是由于缺少映射的 Action 引起的。
Rails.application.routes.draw do
# url action
get 'script/index' => 'script#index'
get 'landing/index' => 'landing#index'
root 'script#index'
end
关于ruby-on-rails - rake 道错误 “Missing :action key on routes definition”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25586310/