没有正确部署到Heroku

时间:2013-09-16 11:16:05

标签: ruby-on-rails ruby ruby-on-rails-3 heroku

我刚刚开始创建一个rails应用程序并尝试将其部署到Heroku但是经过几个小时的尝试后我仍然得到“你正在寻找的页面不存在”。

我尝试过几种方法,比如预编译资产,编辑路径文件等。该应用程序启动并在我的本地计算机上运行,​​但不是在我推送到heroku时。

这是Heroku日志文件:

2013-09-16T10:44:40.197979+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-              4.0.0/lib/rails/rack/logger.rb:38:in `call_app'
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-    4.0.0/lib/rails/rack/logger.rb:21:in `block in call'
2013-09-16T10:44:40.197979+00:00 app[web.1]: 
2013-09-16T10:44:40.197979+00:00 app[web.1]: 
2013-09-16T10:44:40.197979+00:00 app[web.1]: I, [2013-09-16T10:44:37.337563 #2]  INFO --  : Started GET "/hello.html" for 193.1.208.119 at 2013-09-16 10:44:37 +0000
2013-09-16T10:44:40.197979+00:00 app[web.1]: F, [2013-09-16T10:44:37.338599 #2] FATAL -- : 
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-09-16T10:44:40.198210+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T10:44:40.198760+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T10:44:40.198760+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T10:44:40.198760+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T10:44:40.198760+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T10:44:40.198760+00:00 app[web.1]:   vendor/ruby- 2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T10:44:40.198760+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T10:44:40.198760+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T10:44:40.198760+00:00 app[web.1]: 
2013-09-16T10:44:40.198963+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:38:in `call_app'
2013-09-16T10:44:40.198760+00:00 app[web.1]: I, [2013-09-16T10:44:40.195362 #2]  INFO -- : Started GET "/hello.html" for 193.1.208.119 at 2013-09-16 10:44:40 +0000
2013-09-16T10:44:40.198963+00:00 app[web.1]: F, [2013-09-16T10:44:40.196450 #2] FATAL --  : 
2013-09-16T10:44:40.198963+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/hello.html"):
2013-09-16T10:44:40.198963+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-09-16T10:44:40.198963+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-09-16T10:44:40.198760+00:00 app[web.1]: 
2013-09-16T10:44:40.198963+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `block in call'
2013-09-16T10:44:40.198963+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-09-16T10:44:40.198963+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T10:44:40.198963+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-09-16T10:44:40.198963+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T10:44:40.199524+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T10:44:40.199524+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T10:44:40.199524+00:00 app[web.1]: 
2013-09-16T10:44:40.199524+00:00 app[web.1]: 
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T10:44:40.199321+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T10:44:40.199066+00:00 heroku[router]: at=info method=GET path=/hello.html host=floating-brook-3441.herokuapp.com fwd="193.1.208.119" dyno=web.1 connect=1ms service=5ms status=404 bytes=1351
2013-09-16T10:45:59.613412+00:00 heroku[router]: at=info method=GET path=/hello.html host=floating-brook-3441.herokuapp.com fwd="193.1.208.119" dyno=web.1 connect=3ms service=22ms status=404 bytes=1351
2013-09-16T10:57:34.586556+00:00 heroku[web.1]: State changed from up to starting
2013-09-16T10:57:36.295804+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-09-16T10:57:36.579908+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-09-16T10:57:36.579908+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2013-09-16T10:57:36.579908+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-09-16T10:57:36.579908+00:00 app[web.1]: [2013-09-16 10:57:36] FATAL SignalException: SIGTERM
2013-09-16T10:57:36.579908+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2013-09-16T10:57:36.579908+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-09-16T10:57:36.579908+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2013-09-16T10:57:36.579908+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-09-16T10:57:36.579908+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-09-16T10:57:36.580129+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-09-16T10:57:36.579908+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-09-16T10:57:36.580129+00:00 app[web.1]:    bin/rails:4:in `require'
2013-09-16T10:57:36.580129+00:00 app[web.1]:    bin/rails:4:in `<main>'
2013-09-16T10:57:36.580129+00:00 app[web.1]: [2013-09-16 10:57:36] INFO  going to shutdown ...
2013-09-16T10:57:36.580129+00:00 app[web.1]: [2013-09-16 10:57:36] INFO  WEBrick::HTTPServer#start done.
2013-09-16T10:57:36.613536+00:00 app[web.1]: I, [2013-09-16T10:45:59.594930 #2]  INFO -- : Started GET "/hello.html" for 193.1.208.119 at 2013-09-16 10:45:59 +0000
2013-09-16T10:57:36.613536+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/hello.html"):
2013-09-16T10:57:36.613536+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-09-16T10:57:36.613536+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-09-16T10:57:36.613536+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:38:in `call_app'
2013-09-16T10:57:36.613536+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `block in call'
2013-09-16T10:57:36.613536+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-09-16T10:57:36.613536+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T10:57:36.613754+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T10:57:36.613913+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T10:57:36.613913+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T10:57:36.613913+00:00 app[web.1]: 
2013-09-16T10:57:36.613913+00:00 app[web.1]: 
2013-09-16T10:57:36.613913+00:00 app[web.1]: Exiting
2013-09-16T10:57:36.613913+00:00 app[web.1]:   vendor/ruby-   2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T10:57:36.613536+00:00 app[web.1]: F, [2013-09-16T10:45:59.596030 #2] FATAL -- : 
2013-09-16T10:57:36.613536+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-09-16T10:57:37.805884+00:00 heroku[web.1]: Process exited with status 143
2013-09-16T10:57:40.050418+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 32850 -e $RAILS_ENV`
2013-09-16T10:57:42.473797+00:00 app[web.1]: [2013-09-16 10:57:42] INFO  WEBrick 1.3.1
2013-09-16T10:57:42.473797+00:00 app[web.1]: [2013-09-16 10:57:42] INFO  ruby 2.0.0 (2013-06-27) [x86_64-linux]
2013-09-16T10:57:42.473996+00:00 app[web.1]: [2013-09-16 10:57:42] INFO  WEBrick::HTTPServer#start: pid=2 port=32850
2013-09-16T10:57:42.620190+00:00 heroku[web.1]: State changed from starting to up
2013-09-16T10:58:08.597814+00:00 heroku[router]: at=info method=GET path=/ host=floating-brook-3441.herokuapp.com fwd="193.1.208.119" dyno=web.1 connect=1ms service=246ms status=404 bytes=1351

这是我的Gemfile

source 'https://rubygems.org'
ruby '2.0.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'


group :development do
gem 'sqlite3', '1.3.7'
end  

group :production do
gem 'pg'
end


gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'

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

非常欢迎任何帮助!

谢谢, Ť

1 个答案:

答案 0 :(得分:4)

使用Rails 4,您需要手动添加插件以向Gemfile提供静态资源:

gem 'rails_log_stdout',           github: 'heroku/rails_log_stdout'
gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'