由于500个错误,部署到Heroku后未加载资产

ghhaqwfi  于 11个月前  发布在  其他
关注(0)|答案(1)|浏览(80)

我有一个Web应用程序在Heroku上运行了几年,没有任何问题。最近我升级到了Rails6.1,在我的开发环境中,CSS样式工作得很好。当我部署到Heroku时,我没有看到任何错误,但是在部署之后,没有应用任何样式。当我检查时,我看到所有资产都返回500错误:


的数据
这是我在日志中看到的错误:

Rack app error handling request { GET /assets/application-89108843b4f1bbe6098618a2216bf4f15c3be72b7076f9b443d058091a23386f.css }
#<NoMethodError: undefined method `match?' for #<ActionDispatch::FileHandler:0x000056220df0c280>>
/app/vendor/bundle/ruby/2.7.0/gems/heroku-deflater-0.6.3/lib/heroku-deflater/serve_zipped_assets.rb:31:in `call'

字符串
是什么原因让它突然失效了呢?我尝试在部署之前预编译资产,但这没有什么区别。

wkyowqbh

wkyowqbh1#

由于您正在使用Rails6.1并在Heroku上部署,因此不需要使用gem 'heroku-deflater'
从Gemfile中删除它,更多信息可以在这里找到https://github.com/romanbsd/heroku-deflater/issues/54

相关问题