我正在将我的应用升级到ruby 2.6.5,似乎是链轮4.0.2导致了这个问题。我找到的大多数答案都是降级到链轮3.7.2(我在本地使用),但是当在Heroku推送过程中编译资产时,我得到了以下错误:
remote: NoMethodError: undefined method `start_with?' for #<Regexp:0x00005582ab94a790>
remote: /tmp/build_f56a8b75/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.2/lib/sprockets/uri_utils.rb:78:in `valid_asset_uri?'
remote: /tmp/build_f56a8b75/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.2/lib/sprockets/resolve.rb:27:in `resolve'
remote: /tmp/build_f56a8b75/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.2/lib/sprockets/base.rb:79:in `find_asset'
remote: /tmp/build_f56a8b75/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.2/lib/sprockets/base.rb:88:in `find_all_linked_assets'
remote: /tmp/build_f56a8b75/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.2/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
我已将config/initializers/assets.rb
修改为:
# Rails.application.config.assets.precompile << /\.(?:svg|eot|woff|ttf)\z/
Rails.application.config.assets.precompile << ["*.svg", "*.eot", "*.woff", "*.ttf"]
但是错误仍然发生。有什么办法可以解决这个问题吗?
1条答案
按热度按时间huus2vyu1#
我也面临着同样的错误。
我添加了以下版本指定的宝石由于降级链轮和它部署成功。
让菲