Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

ActionController::RoutingError (No route matches [GET] "/"):

Writer Sophia Terry

I'm playing around with a tutorial which uses unicorn and rails. I'm completely new to rails and for the purpose of the tutorial all I've done for the project is bundle exec rails new rails-starter with no further app modifications.

When I run bundle exec unicorn -c config/unicorn.rb -E production I get the message in the browser:

The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved.

The log shows:

ActionController::RoutingError (No route matches [GET] "/"): / `call' / `call' / `call_app' / `block in call' / `block in tagged' / `tagged' / `tagged' / `call' / `call' / `call' / `call' / `call' / `call' / `call' / `call' / `process_client' / `worker_loop' / `spawn_missing_workers' / `start' / `<top (required)>' / `load' / `<main>'

However if I just run the rails app via bundle exec rails server I can successfully access via [IP]:3000

I suspect the error is something to do with ActionController::RoutingError (No route matches [GET] "/"): however I lack the rails knowledge to figure out the fix.

1 Answer

You need to setup a root route in routes.rb file.

root :to => 'index#index'

Where the first index is the controller name (IndexController) and the second index is the action name in the IndexController.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy