Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rake route Error "Missing :action key on routes definition"

I am getting

$ 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................ 

Here is my Routes.rb

Rails.application.routes.draw do   get 'script/index'    get 'landing/index'    root 'landing/index' end 

What is causing the problem and how do I fix it.

like image 890
Tithos Avatar asked Aug 30 '14 20:08

Tithos


1 Answers

The Rails router recognizes URLs and dispatches them to a controller's action. The error is caused by missing out the mapped action.

Rails.application.routes.draw do   #   url               action   get 'script/index' => 'script#index'   get 'landing/index' => 'landing#index'   root 'script#index' end 
like image 78
Kaleidoscope Avatar answered Oct 16 '22 18:10

Kaleidoscope