简体   繁体   English

heroku“您要查找的页面不存在。”遵循Hartl的RoR指南

[英]heroku “The page you were looking for doesn't exist.” following Hartl's RoR guide

I'm following Michael Hartl's guide on learning Ruby on Rails and I just finished Chapter 5. 我正在遵循迈克尔·哈特尔(Michael Hartl)关于学习Ruby on Rails的指南,我刚刚完成了第5章。

I get the localhost to load just fine and pages work and look as expected but when I try the final line to get heroku going "heroku open" I get the following screen ( http://take.ms/4KuwQ ). 我让localhost可以正常加载,并且页面可以正常工作,并且按预期方式运行,但是当我尝试最后一行使heroku进入“ heroku打开”状态时,我得到以下屏幕( http://take.ms/4KuwQ )。

I've tried checking other stackoverflow questions but still couldn't find the answer. 我试过检查其他stackoverflow问题,但仍然找不到答案。 The guide says to look at Heroku logs to debug but I can not find the solution. 该指南说要查看要调试的Heroku日志,但找不到解决方案。

Below is my entire Heroku log. 以下是我的整个Heroku日志。 I have also attached a screen grab ( http://take.ms/MaJhz ) of what I believe would be the issue but can not find the solution. 我还附上了我认为可能会导致问题但找不到解决方案的屏幕截图( http://take.ms/MaJhz )。

Entire GEM file: 整个GEM文件:

source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.4'
gem 'bootstrap-sass', '2.3.2.0'
gem 'sprockets', '2.11.0'

group :development, :test do
  gem 'sqlite3', '1.3.8'
  gem 'rspec-rails', '2.13.1'
end

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 'pg', '0.15.1'
  gem 'rails_12factor', '0.0.2'
end

Entire Heroku log: 整个Heroku日志:

2014-04-16T23:13:14.780234+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-16T23:13:14.780234+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-16T23:13:14.780234+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-04-16T23:13:14.780234+00:00 app[web.1]: 
2014-04-16T23:13:14.780234+00:00 app[web.1]: 
2014-04-16T23:13:14.780234+00:00 app[web.1]: 
2014-04-16T23:13:14.780234+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2014-04-16T23:13:14.780234+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-04-16T23:13:14.781190+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-04-16T23:13:14.781190+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-04-16T23:13:14.781190+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-04-16T23:13:14.781190+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-04-16T23:13:14.781190+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-04-16T23:13:14.781190+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-04-16T23:13:14.781190+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-04-16T23:13:14.781574+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-04-16T23:13:14.780234+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-04-16T23:13:14.781190+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-04-16T23:13:14.781190+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-04-16T23:13:14.781574+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-04-16T23:13:14.781574+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-16T23:13:14.781574+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-04-16T23:13:14.781574+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-16T23:13:14.781190+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-04-16T23:13:14.781574+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-04-16T23:13:14
.781574+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-04-16T23:13:14.781574+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-04-16T23:13:14.781574+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-04-16T23:13:14.781574+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-04-16T23:13:14.782201+00:00 app[web.1]: 
2014-04-16T23:13:14.782201+00:00 app[web.1]: 
2014-04-16T23:13:14.783441+00:00 heroku[router]: at=info method=GET path=/ host=damp-inlet-1921.herokuapp.com request_id=f19f1fc7-892c-4b1f-adaa-324bc982b675 fwd="12.172.95.252" dyno=web.1 connect=1ms service=350ms status=404 bytes=1616
2014-04-16T23:13:15.127296+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=damp-inlet-1921.herokuapp.com request_id=6b5c668d-189b-42d6-90b9-1bffb1d7f085 fwd="12.172.95.252" dyno=web.1 connect=1ms service=4ms status=304 bytes=133
2014-04-16T23:13:13.951347+00:00 heroku[web.1]: State changed from starting to up
2014-04-16T23:14:24.040669+00:00 heroku[api]: Starting process with command `bundle exec rake db:setup` by edgarmatevosyan@gmail.com
2014-04-16T23:14:27.184585+00:00 heroku[run.2955]: Awaiting client
2014-04-16T23:14:27.219046+00:00 heroku[run.2955]: Starting process with command `bundle exec rake db:setup`
2014-
04-16T23:14:27.274133+00:00 heroku[run.2955]: State changed from starting to up
2014-04-16T23:14:30.722822+00:00 heroku[run.2955]: State changed from up to complete
2014-04-16T23:14:30.708839+00:00 heroku[run.2955]: Process exited with status 1
2014-04-16T23:14:37.126865+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by edgarmatevosyan@gmail.com
2014-04-16T23:14:41.972185+00:00 heroku[run.8896]: Awaiting client
2014-04-16T23:14:41.719744+00:00 heroku[run.8896]: State changed from starting to up
2014-04-16T23:14:42.035485+00:00 heroku[run.8896]: Starting process with command `bundle exec rake db:migrate`
2014-04-16T23:14:48.674142+00:00 heroku[run.8896]: Process exited with status 0
2014-04-16T23:14:48.685250+00:00 heroku[run.8896]: State changed from up to complete
2014-04-16T23:23:59.044087+00:00 app[web.1]: Started GET "/" for 12.172.95.252 at 2014-04-16 23:23:59 +0000
2014-04-16T23:23:59.062462+00:00 app[web.1]: Started GET "/" for 12.172.95.252 at 2014-04-16 23:23:59 +0000
2014-04-16T23:23:59.289420+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2014-04-16T23:23:59.289420+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-04-16T23:23:59.289420+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'
201
4-04-16T23:23:59.289420+00:00 app[web.1]: 
2014-04-16T23:23:59.289420+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-04-16T23:23:59.289420+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-04-16T23:23:59.289420+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-04-16T23:23:59.289420+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-04-16T23:23:59.289420+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-04-16T23:23:59.289420+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-04-16T23:23:59.289665+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-04-16T23:23:59.289665+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-04-16T23:23:59.289665+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-04-16T23:23:59.289665+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-04-16T23:23:59.289665+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-04-16T23:23:59.289665+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-04-16T23:23:59.289665+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-04-16T23:23:59.289665+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-04-16T23:23:59.289857+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-04-16T23:23:59.289857+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-16T23:23:59.289857+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-16T23:23:59.289857+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-04-16T23:23:59.289857+00:00 app[web.1]: 
2014-04-16T23:23:59.289857+00:00 app[web.1]: 
2014-04-16T23:23:59.293033+00:00 app[web.1]: 
2014-04-16T23:23:59.293033+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2014-04-16T23:23:59.293033+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-04-16T23:23:59.293033+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-04-16T23:23:59.293033+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-04-16T23:23:59.293033+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-04-16T23:23:59.293033+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-04-16T23:23:59.293033+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-04-16T23:23:59.293033+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-04-16T23:23:59.293250+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-04-16T23:23:59.293033+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-04-16T23:23:59.293250+00:00 app[web.1]: 
  vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-04-16T23:23:59.293250+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-04-16T23:23:59.293250+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-04-16T23:23:59.293250+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/engine.rb:511:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.4/lib/rails/application.rb:97:in `call'
2014-04-16T23:23:59.293250+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-04-16T23:23:59.293250+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-04-16T23:23:59.293486+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-04-16T23:23:59.293486+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-04-16T23:23:59.293486+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-04-16T23:23:59.293486+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-04-16T23:23:59.293486+00:00 app[web.1]: 
2014-04-16T23:23:59.293486+00:00 app[web.1]: 
2014-04-16T23:23:59.317925+00:00 heroku[router]: at=info method=GET path=/ host=damp-inlet-1921.herokuapp.com request_id=b7a6b34b-bab5-4603-b19e-5e00f6239f27 fwd="12.172.95.252" dyno=web.1 connect=4ms service=4147ms status=404 bytes=1616

Here is the routes.rb file: 这是routes.rb文件:

SampleApp::Application.routes.draw do
  get "users/new"
  root  'static_pages#home'
  match '/signup',  to: 'users#new',            via: 'get'
  match '/help',    to: 'static_pages#help',    via: 'get'
  match '/about',   to: 'static_pages#about',   via: 'get'
  match '/contact', to: 'static_pages#contact', via: 'get'
end

The screengrab log says no route matches a GET request on '/'. 屏幕截图日志显示没有路由与“ /”上的GET请求匹配。 Are you sure you've set a root route? 您确定设置了根路由吗? It would look like this: (the routes file is found in 'config/routes.rb') 它看起来像这样:(在“ config / routes.rb”中找到了路由文件)

root to: 'controller#method'

Where controller is the controller you wish to use 'users' or 'posts' etc.. and the method would most likely be an index method. 其中controller是您希望使用“用户”或“帖子”等的控制器,并且该方法很可能是索引方法。

Take a quick look at routes.rb, and if you do have a line like I've mentioned above, just post up your routes.rb file for us to take a look. 快速浏览routes.rb,如果您确实有如上所述的一行,请发布您的routes.rb文件,让我们看看。

暂无
暂无

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

相关问题 无法在heroku上部署应用程序,总是得到“您要查找的页面不存在。”错误 - Can't deploy app on heroku, always get “The page you were looking for doesn't exist.” error 在商店上安装后的Heroku Shopify应用程序“您要查找的页面不存在。” - Heroku Shopify App after installation on shop “The page you were looking for doesn't exist.” Heroku Rails设置“您正在寻找的页面不存在。” - Heroku Rails Setup “The page you were looking for doesn't exist.” Cloud9,GitHub和Heroku(您要查找的页面不存在。) - Cloud9, GitHub and Heroku (The page you were looking for doesn't exist.) rails heroku错误:未定义路线,但路线存在(您要查找的页面不存在。) - rails heroku error: no route defined, but route is there (The page you were looking for doesn't exist.) “您要查找的页面不存在。”编辑表单 - “The page you were looking for doesn't exist.” edit form 为什么当我在Heroku的另一个窗口中打开新链接时显示“您要查找的页面不存在”的原因。 - Why is it when I open a new link in another window on Heroku it says “The page you were looking for doesn't exist.” Heroku:您要查找的页面不存在 - Heroku: The page you were looking for doesn't exist 您所寻找的页面不存在 - Heroku The page you were looking for doesn't exist Rails / Heroku您正在寻找的页面不存在 - Rails/Heroku The page you were looking for doesn't exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM