Heroku - “此页面不存在”错误

时间:2014-01-02 04:54:04

标签: ruby-on-rails ruby heroku deployment ruby-on-rails-4

我正在通过Rails教程,我正在尝试将我的演示应用程序部署到Heroku,并且没有太多运气 - 当我访问该页面时,我收到“此页面不存在”错误。我可以在localhost服务器上运行该应用程序。我的日志在下面......我是Rails的新手,所以任何方向都会受到赞赏!

(如果重要的话,我正在运行Rails 4并使用Ruby 2.0.0p353。)

2013-12-31T22:36:10.639947+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=aqueous-scrubland-1350.herokuapp.com fwd="66.108.171.204" dyno=web.1 connect=2ms service=8ms status=304 bytes=0
2013-12-31T22:36:09.524805+00:00 heroku[router]: at=info method=GET path=/ host=aqueous-scrubland-1350.herokuapp.com fwd="66.108.171.204" dyno=web.1 connect=3ms service=251ms status=404 bytes=1351
2013-12-31T23:40:59.592539+00:00 heroku[web.1]: Idling
2013-12-31T23:40:59.592983+00:00 heroku[web.1]: State changed from up to down
2013-12-31T23:41:03.038207+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-12-31T23:41:03.668269+00:00 app[web.1]: [2013-12-31 23:41:03] FATAL SignalException: SIGTERM
2013-12-31T23:41:03.668269+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2013-12-31T23:41:03.668269+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands/server.rb:84:in `start'
2013-12-31T23:41:03.668269+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2013-12-31T23:41:03.668269+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
2013-12-31T23:41:03.668269+00:00 app[web.1]:  /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2013-12-31T23:41:03.668269+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:14:in `run'
2013-12-31T23:41:03.668269+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
2013-12-31T23:41:03.668269+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
2013-12-31T23:41:03.668516+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
2013-12-31T23:41:03.668516+00:00 app[web.1]:  bin/rails:4:in `require'
2013-12-31T23:41:03.668516+00:00 app[web.1]:  bin/rails:4:in `<main>'
2013-12-31T23:41:03.668516+00:00 app[web.1]: [2013-12-31 23:41:03] INFO  going to shutdown ...
2013-12-31T23:41:03.668516+00:00 app[web.1]: [2013-12-31 23:41:03] INFO  WEBrick::HTTPServer#start done.
2013-12-31T23:41:03.668516+00:00 app[web.1]: Exiting
2013-12-31T23:41:03.668269+00:00 app[web.1]:  /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:78:in `block in <top (required)>'
2013-12-31T23:41:05.125759+00:00 heroku[web.1]: Process exited with status 143

2 个答案:

答案 0 :(得分:0)

也许您没有指定根路径?您使用的是哪个教程?如果你正在做Hartl教程的第一部分,第一章应该显示你得到的错误(因为他们没有进入路由等可能会在下一章中发生) - http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

答案 1 :(得分:0)

将更改推送到Heroku后,我遇到了同样的问题。正如@derekyau指出的那样,这是因为heroku缺少根页。

添加指向欢迎页面的默认根页面,这解决了我的问题。要更新欢迎页面,请按照此处的说明进行操作:

Welcome/home page in Ruby on Rails - best practice