我在Heroku服务器上部署了一个rails应用程序,当我打开应用程序时,索引页面打开没有任何问题。但是当我点击索引页面上的任何链接时,它会出错。以下是Heroku的日志。
2016-10-20T20:35:44.644654+00:00 app[web.1]: I, [2016-10-20T20:35:44.644578 #3] INFO -- : [422ffd5c-1b65-4391-877d-b6f52f398000] Started GET "/assets/demo.css" for 91.75.228.164 at 2016-10-20 20:35:44 +0000
2016-10-20T20:35:44.645209+00:00 app[web.1]: F, [2016-10-20T20:35:44.645147 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000]
2016-10-20T20:35:44.645272+00:00 app[web.1]: F, [2016-10-20T20:35:44.645213 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] ActionController::RoutingError (No route matches [GET] "/assets/demo.css"):
2016-10-20T20:35:44.645330+00:00 app[web.1]: F, [2016-10-20T20:35:44.645272 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000]
2016-10-20T20:35:44.645376+00:00 app[web.1]: F, [2016-10-20T20:35:44.645320 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/debug_exceptions.rb:53:in `call'
2016-10-20T20:35:44.645427+00:00 app[web.1]: F, [2016-10-20T20:35:44.645371 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
2016-10-20T20:35:44.645473+00:00 app[web.1]: F, [2016-10-20T20:35:44.645421 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:36:in `call_app'
2016-10-20T20:35:44.645527+00:00 app[web.1]: F, [2016-10-20T20:35:44.645469 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:24:in `block in call'
2016-10-20T20:35:44.645575+00:00 app[web.1]: F, [2016-10-20T20:35:44.645522 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/tagged_logging.rb:70:in `block in tagged'
2016-10-20T20:35:44.645640+00:00 app[web.1]: F, [2016-10-20T20:35:44.645593 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/tagged_logging.rb:26:in `tagged'
2016-10-20T20:35:44.645686+00:00 app[web.1]: F, [2016-10-20T20:35:44.645635 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/tagged_logging.rb:70:in `tagged'
2016-10-20T20:35:44.645733+00:00 app[web.1]: F, [2016-10-20T20:35:44.645682 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:24:in `call'
2016-10-20T20:35:44.645786+00:00 app[web.1]: F, [2016-10-20T20:35:44.645729 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/request_id.rb:24:in `call'
2016-10-20T20:35:44.645833+00:00 app[web.1]: F, [2016-10-20T20:35:44.645782 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/method_override.rb:22:in `call'
2016-10-20T20:35:44.645879+00:00 app[web.1]: F, [2016-10-20T20:35:44.645828 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/runtime.rb:22:in `call'
2016-10-20T20:35:44.645926+00:00 app[web.1]: F, [2016-10-20T20:35:44.645874 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
2016-10-20T20:35:44.645971+00:00 app[web.1]: F, [2016-10-20T20:35:44.645921 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/executor.rb:12:in `call'
2016-10-20T20:35:44.646025+00:00 app[web.1]: F, [2016-10-20T20:35:44.645968 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/static.rb:136:in `call'
2016-10-20T20:35:44.646072+00:00 app[web.1]: F, [2016-10-20T20:35:44.646021 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/rack-2.0.1/lib/rack/sendfile.rb:111:in `call'
2016-10-20T20:35:44.646117+00:00 app[web.1]: F, [2016-10-20T20:35:44.646067 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:522:in `call'
2016-10-20T20:35:44.646163+00:00 app[web.1]: F, [2016-10-20T20:35:44.646113 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/configuration.rb:225:in `call'
2016-10-20T20:35:44.646222+00:00 app[web.1]: F, [2016-10-20T20:35:44.646158 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/server.rb:578:in `handle_request'
2016-10-20T20:35:44.646276+00:00 app[web.1]: F, [2016-10-20T20:35:44.646218 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/server.rb:415:in `process_client'
2016-10-20T20:35:44.646322+00:00 app[web.1]: F, [2016-10-20T20:35:44.646271 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/server.rb:275:in `block in run'
2016-10-20T20:35:44.646367+00:00 app[web.1]: F, [2016-10-20T20:35:44.646318 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/thread_pool.rb:116:in `call'
2016-10-20T20:35:44.646414+00:00 app[web.1]: F, [2016-10-20T20:35:44.646363 #3] FATAL -- : [422ffd5c-1b65-4391-877d-b6f52f398000] vendor/bundle/ruby/2.2.0/gems/puma-3.6.0/lib/puma/thread_pool.rb:116:in `block in spawn_thread'
答案 0 :(得分:0)
您忘记将文件assets/demo.css
添加到您的仓库。
哦,并将其添加到您的预编译路径:config/initializers/assets.rb
(或旧版应用的config/application.rb
),如下所示:
config.assets.precompile << 'demo.css'