简体   繁体   English

Rails / Heroku您正在寻找的页面不存在

[英]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. 我收到来自Heroku的“您要查找的页面不存在”错误。 App runs fine in development and production, but no go on Heroku. App在开发和生产中运行良好,但在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 . “ heroku日志”建议ActionController::RoutingError (No route matches [GET] "/"):出现路由问题ActionController::RoutingError (No route matches [GET] "/"):我包括config / routes.rbheroku日志的结果,也包括我的Gemfile

config/routes.rb 配置/ 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 Heroku日志

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 的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

I got the similar problem; 我遇到了类似的问题; however, after changing 1 line code of production.rb located in config/environments/production.rb from 但是,在更改了位于config / environments / production.rb中的1行production.rb代码后,

config.assets.compile = false
to

config.assets.compile = true

commit the new change. 提交新更改。

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 您要做的就是将对domain.com/welcome/index任何请求发送到不存在的控制器

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

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. 我按照上面的建议调整了路线,但是我也犯了一些git错误。 I thought I was working from the master branch, but I think I was working from a branch and not merging before pushing. 我以为自己是在master分支中工作,但是我想是在一个分支中工作,并且在推送之前没有合并。 Took some re-reading of git documentation to get it figured out. 重新阅读了git文档以弄清楚它。 http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM