user2364424
user2364424

Reputation: 101

Rails/Heroku The page you were looking for doesn't exist

I'm getting the "The page you were looking for doesn't exist" error from Heroku. App runs fine in development and production, but no go on Heroku.

"heroku logs" suggests a routing issue with ActionController::RoutingError (No route matches [GET] "/"): I've included config/routes.rb and results of heroku logs, also my Gemfile.

config/routes.rb

    Foodsterbater::Application.routes.draw do
      get "/welcome/index"
      get "static_pages/home"
      get "static_pages/about"
      get "static_pages/contact"
      resources :gigs

      resources :users

      root 'welcome#index'
    end

Heroku logs

2014-05-27T04:58:51.862730+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-05-27T04:58:51.862756+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-05-27T04:58:51.862732+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-05-27T04:58:51.862754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `block in call'
2014-05-27T04:58:51.862770+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-05-27T04:58:51.862772+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-05-27T04:58:51.862774+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-05-27T04:58:51.862792+00:00 app[web.1]: 
2014-05-27T04:58:51.859086+00:00 app[web.1]: Started GET "/" for 67.160.237.167 at 2014-05-27 04:58:51 +0000
2014-05-27T04:58:51.862666+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `block in call'
2014-05-27T04:58:51.862691+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-05-27T04:58:51.862733+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-05-27T04:58:51.862758+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-05-27T04:58:51.862778+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-05-27T04:58:51.859100+00:00 app[web.1]: Started GET "/" for 67.160.237.167 at 2014-05-27 04:58:51 +0000
2014-05-27T04:58:51.862664+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:38:in `call_app'
2014-05-27T04:58:51.862693+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-05-27T04:58:51.862752+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:38:in `call_app'
2014-05-27T04:58:51.862768+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-05-27T04:58:51.862783+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-05-27T04:58:51.862653+00:00 app[web.1]: 
2014-05-27T04:58:51.862681+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-05-27T04:58:51.862737+00:00 app[web.1]: 
2014-05-27T04:58:51.862762+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `call'
2014-05-27T04:58:51.862785+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-05-27T04:58:51.862668+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-05-27T04:58:51.862683+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-05-27T04:58:51.862748+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-05-27T04:58:51.862776+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-05-27T04:58:51.862787+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-05-27T04:58:51.862670+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-05-27T04:58:51.862715+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-05-27T04:58:51.862750+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-05-27T04:58:51.862767+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-05-27T04:58:51.862780+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-05-27T04:58:51.862790+00:00 app[web.1]: 
2014-05-27T04:58:51.862674+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `call'
2014-05-27T04:58:51.862687+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-05-27T04:58:51.862744+00:00 app[web.1]: 
2014-05-27T04:58:51.862765+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-05-27T04:58:51.862789+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-05-27T04:58:51.862676+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-05-27T04:58:51.862689+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-05-27T04:58:51.862735+00:00 app[web.1]: 
2014-05-27T04:58:51.862761+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-05-27T04:58:51.862782+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-05-27T05:19:10.490117+00:00 heroku[router]: at=info method=GET path=/ host=gentle-shelf-817
2.herokuapp.com request_id=7bd56a2d-92ed-4fff-8809-4d0fdbbc356f fwd="67.160.237.167" dyno=web.1 connect=1ms service=35ms status=404 bytes=1616
2014-05-27T05:19:10.491972+00:00 app[web.1]: Started GET "/" for 67.160.237.167 at 2014-05-27 05:19:10 +0000
2014-05-27T05:19:10.495303+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-05-27T05:19:10.495305+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-05-27T05:19:10.491984+00:00 app[web.1]: Started GET "/" for 67.160.237.167 at 2014-05-27 05:19:10 +0000
2014-05-27T05:19:10.495297+00:00 app[web.1]: 
2014-05-27T05:19:10.495300+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2014-05-27T05:19:10.495307+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:38:in `call_app'
2014-05-27T05:19:10.495312+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-05-27T05:19:10.495355+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-05-27T05:19:10.495352+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-05-27T05:19:10.495353+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-05-27T05:19:10.495310+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-05-27T05:19:10.495313+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-05-27T05:19:10.495322+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-05-27T05:19:10.495317+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-05-27T05:19:10.495325+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-05-27T05:19:10.495350+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-05-27T05:19:10.495308+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `block in call'
2014-05-27T05:19:10.495356+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-05-27T05:19:10.495361+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-05-27T05:19:10.495368+00:00 app[web.1]: 
2014-05-27T05:19:10.495390+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-05-27T05:19:10.495315+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `call'
2014-05-27T05:19:10.495320+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-05-27T05:19:10.495363+00:00 app[web.1]: 
2014-05-27T05:19:10.495379+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-05-27T05:19:10.495359+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-05-27T05:19:10.495380+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-05-27T05:19:10.495318+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-05-27T05:19:10.495377+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-05-27T05:19:10.495370+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2014-05-27T05:19:10.495386+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-05-27T05:19:10.495373+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-05-27T05:19:10.495383+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-05-27T05:19:10.495376+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `block in call'
2014-05-27T05:19:10.495385+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-05-27T05:19:10.495362+00:00 app[web.1]: 
2014-05-27T05:19:10.495371+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-05-27T05:19:10.495388+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.4/lib/active_support/cache/strategy/local_cache.rb:83:in `ca
ll'
2014-05-27T05:19:10.495415+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-05-27T05:19:10.495323+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.4/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-05-27T05:19:10.495358+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-05-27T05:19:10.495375+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:38:in `call_app'
2014-05-27T05:19:10.495382+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/rack/logger.rb:20:in `call'
2014-05-27T05:19:10.495411+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-05-27T05:19:10.495412+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-05-27T05:19:10.495417+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-05-27T05:19:10.495409+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-05-27T05:19:10.495406+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-05-27T05:19:10.495391+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-05-27T05:19:10.495418+00:00 app[web.1]: 
2014-05-27T05:19:10.495408+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-05-27T05:19:10.495420+00:00 app[web.1]: 
2014-05-27T05:19:10.495414+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'

Gemfile

   group :test do
      gem 'selenium-webdriver', '2.35.1'
      gem 'capybara', '2.1.0'
    end

    gem 'sass-rails', '4.0.1'
    gem 'uglifier', '2.1.1'
    gem 'coffee-rails', '4.0.1'
    gem 'jquery-rails', '3.0.4'
    gem 'turbolinks', '1.1.1'
    gem 'jbuilder', '1.0.2'

    group :doc do
      gem 'sdoc', '0.3.20', require: false
    end

    group :production do
      gem 'rails_12factor', '0.0.2'
      gem 'unicorn'
      gem 'rails_log_stdout',           github: 'heroku/rails_log_stdout'
      gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'
    end

                                                                     35,0-1        Bot

Upvotes: 0

Views: 485

Answers (3)

user2364424
user2364424

Reputation: 101

I fixed the issue, but I'm not positive how. I adjusted my routes as suggested above, but I was also making some git mistakes. I thought I was working from the master branch, but I think I was working from a branch and not merging before pushing. Took some re-reading of git documentation to get it figured out. http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging

Upvotes: 0

Richard Peck
Richard Peck

Reputation: 76774

I would personally say this is your error:

#config/routes.rb
get "/welcome/index"

What is this trying to achieve exactly? All you're going to do is send any request for domain.com/welcome/index to a non-existent controller

I would change your routes to this:

   #config/routes.rb
   Foodsterbater::Application.routes.draw do
      resources :gigs, :users
      resources :static_pages, only: [] do
           get :home
           get :about
           get :contact
      end
      root 'welcome#index'
    end

Upvotes: 0

Arihant Godha
Arihant Godha

Reputation: 2459

I got the similar problem; however, after changing 1 line code of production.rb located in config/environments/production.rb from

config.assets.compile = false
to

config.assets.compile = true

commit the new change.

Upvotes: 1

Related Questions