我试图让我的部署环境显示在我的开发环境中正常显示的图像,因此我实现了此处列出的解决方案:
Rails 4 images not loading on heroku
将建议的行添加到production.rb。
production.rb
config.serve_static_assets = true
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
config.assets.compile = true
我没有将gem 'rails_12factor', group: :production
添加到gemfile中,因为Rails 5.0.1的文档声明这对于当前版本来说不是必需的。
我也在同一个文件中取消注释了一行。
# config.assets.css_compressor = :sass
现在,Heroku应用程序在尝试访问时只显示错误消息。
应用程序错误应用程序和页面发生错误 无法提供服务。如果您是应用程序所有者,请检查日志 详情。
我在错误日志中看不到任何可以帮助我找出错误原因的内容。
017-03-28T13:07:37.952784+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.4.0/bin/puma:10:in `<top (required)>'
2017-03-28T13:07:37.952785+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/puma:22:in `load'
2017-03-28T13:07:37.952785+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/bin/puma:22:in `<top (required)>'
2017-03-28T13:07:38.050615+00:00 heroku[web.1]: State changed from starting to crashed
2017-03-28T13:07:38.032270+00:00 heroku[web.1]: Process exited with status 1
2017-03-28T13:08:28.920318+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/products" host=sheltered-brushlands-26777.herokuapp.com request_id=2aaa884b-3ae2-4e5b-ada0-062c31ca6153 fwd="90.199.11.156" dyno= connect= service= status=503 bytes= protocol=https
2017-03-28T13:08:29.258448+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sheltered-brushlands-26777.herokuapp.com request_id=d0fca11f-bcbf-49da-b32d-616803caedd6 fwd="90.199.11.156" dyno= connect= service= status=503 bytes= protocol=https
2017-03-28T13:08:30.956326+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/products" host=sheltered-brushlands-26777.herokuapp.com request_id=2608e974-e07f-42e5-8203-f8f1c9ea941b fwd="90.199.11.156" dyno= connect= service= status=503 bytes= protocol=https
2017-03-28T13:08:31.260601+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sheltered-brushlands-26777.herokuapp.com request_id=257d4b38-fad5-4a43-858d-ab23a0f0d3f2 fwd="90.199.11.156" dyno= connect= service= status=503 bytes= protocol=https
2017-03-28T13:08:31.743141+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/products" host=sheltered-brushlands-26777.herokuapp.com request_id=7944d42c-1aa0-40f9-953a-856480332db0 fwd="90.199.11.156" dyno= connect= service= status=503 bytes= protocol=https
2017-03-28T13:08:32.041360+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sheltered-brushlands-26777.herokuapp.com request_id=996fc748-cec7-4e28-ad39-ca478a87360c fwd="90.199.11.156" dyno= connect= service= status=503 bytes= protocol=https
我已经恢复了所有更改并再次推送到Heroku,但同样的问题仍然存在。任何人都可以建议一个解决方案,或者我可以通过其他故障排除步骤来帮助找到问题的原因吗?