0

我的环境中的 buildpacks 如下

=== xyz-app Buildpack URLs
1. https://github.com/jasonfb/heroku-buildpack-cedar14-imagemagick704
2. https://github.com/bobbus/image-optim-buildpack
3. heroku/ruby

我正在尝试将image_optimimage_optim_railsimage_optim_pack添加到我在 Heroku Cedar-14 上运行的 Rails 4.1 应用程序中

当我尝试仅使用 image_optim 推送到我的环境时,我能够成功完成构建。添加此宝石时

gem 'image_optim_rails' 并捆绑安装它,然后再次推送到 Heroku,我在构建阶段崩溃了

WARN: pngcrush 1.7.15 at /tmp/codon/vendor/bin/pngcrush (< 1.7.38) does not have blacken flag
remote:        WARN: gifsicle 1.78 at /tmp/codon/vendor/bin/gifsicle (< 1.85) does not support removing extension blocks
remote:        rake aborted!
remote:        ImageOptim::BinResolver::Error: Bin resolving errors:
remote:        pngout worker: `pngout` not found; please provide proper binary or disable this worker (--no-pngout argument or `:pngout => false` through options)
remote:        pngquant worker: `pngquant` not found; please provide proper binary or disable this worker (--no-pngquant argument or `:pngquant => false` through options)
remote:        jhead worker: `jhead` not found; please provide proper binary or disable this worker (--no-jhead argument or `:jhead => false` through options)
remote:        svgo worker: `svgo` not found; please provide proper binary or disable this worker (--no-svgo argument or `:svgo => false` through options)
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/image_optim-0.24.2/lib/image_optim/worker/class_methods.rb:73:in `create_all'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/image_optim-0.24.2/lib/image_optim/worker/class_methods.rb:44:in `create_all_by_format'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/image_optim-0.24.2/lib/image_optim.rb:86:in `initialize'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/image_optim_rails-0.2.0/lib/image_optim/railtie.rb:28:in `new'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/image_optim_rails-0.2.0/lib/image_optim/railtie.rb:28:in `block in <class:Railtie>'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/railties-4.1.14.2/lib/rails/initializable.rb:30:in `instance_exec'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/railties-4.1.14.2/lib/rails/initializable.rb:30:in `run'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/railties-4.1.14.2/lib/rails/initializable.rb:55:in `block in run_initializers'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/railties-4.1.14.2/lib/rails/initializable.rb:54:in `run_initializers'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/railties-4.1.14.2/lib/rails/application.rb:300:in `initialize!'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/railties-4.1.14.2/lib/rails/railtie.rb:194:in `public_send'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/railties-4.1.14.2/lib/rails/railtie.rb:194:in `method_missing'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/config/environment.rb:5:in `<top (required)>'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:247:in `block in require'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:232:in `load_dependency'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.14.2/lib/active_support/dependencies.rb:247:in `require'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/railties-4.1.14.2/lib/rails/application.rb:276:in `require_environment!'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/railties-4.1.14.2/lib/rails/application.rb:405:in `block in run_tasks_blocks'
remote:        /tmp/build_a3bca6e7188e4157414469f76bf31f7d/vendor/bundle/ruby/2.1.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:64:in `block (2 levels) in define'
remote:        Tasks: TOP => environment
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to mackweldon-europa.
remote: 
To git@heroku.com:mackweldon-europa.git
 ! [remote rejected] image-optim-branch -> master (pre-receive hook declined)
4

1 回答 1

0

当我安装了两个 gem 时:

gem 'image_optim_rails'
gem 'image_optim_pack'

(参见toy/image_optim_rails文档)

当推送到 Heroku 时,它可以干净地工作和构建

于 2017-02-19T16:51:47.843 回答