简体   繁体   中英

heroku rake assets:precompile failed unknown compressor

My heroku deployment fail because assets precompile, i never saw this error about unknow compressor and find nothing about it, i would know how fix it and why its happen

Thanks

My Rails App:

Ruby 2.5.1

Rails 6.0.3

My build log

       Bundle completed (3.31s)
       Cleaning up the bundler cache.
-----> Installing node-v12.16.2-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       Yarn executable was not detected in the system.
       Download Yarn at https://yarnpkg.com/en/docs/install
       rake aborted!
       Sprockets::Error: unknown compressor: purger
       /tmp/build_6c3b535f/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/compressing.rb:36:in `css_compressor='
       /tmp/build_6c3b535f/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/railtie.rb:186:in `build_environment'
       /tmp/build_6c3b535f/vendor/bundle/ruby/2.5.0/gems/railties-6.0.3.5/lib/rails/railtie.rb:190:in `public_send'
       /tmp/build_6c3b535f/vendor/bundle/ruby/2.5.0/gems/railties-6.0.3.5/lib/rails/railtie.rb:190:in `method_missing'
       /tmp/build_6c3b535f/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:20:in `environment'
       /tmp/build_6c3b535f/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:42:in `cached'
       /tmp/build_6c3b535f/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:45:in `manifest'
       /tmp/build_6c3b535f/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:143:in `with_logger'
       /tmp/build_6c3b535f/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
       Tasks: TOP => assets:precompile
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

Go to config/environments/production and remove or comment out the line:

config.assets.css_compressor = :purger

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM