简体   繁体   English

在生产中使用image_optim_pack丢失二进制文件错误

[英]Missing binaries error with image_optim_pack in production

I'm trying to deploy a Rails app with paperclip-optimizer and it's giving me an error about missing binaries. 我正在尝试使用paperclip-optimizer部署Rails应用程序,它给了我一个关于丢失二进制文件的错误。 I have bundled image_optim_pack to provide the binaries but still get this: 我已经捆绑了image_optim_pack来提供二进制文件,但仍然得到这个:

ImageOptim::BinResolver::Error occurred
pngcrush worker: `pngcrush` not found; please provide proper binary or di=
sable this worker (--no-pngcrush argument or `:pngcrush =3D> false` throu=
gh options)
advpng worker: `advpng` not found; please provide proper binary or disabl=
e this worker (--no-advpng argument or `:advpng =3D> false` through optio=
ns)
optipng worker: `optipng` not found; please provide proper binary or disa=
ble this worker (--no-optipng argument or `:optipng =3D> false` through o=
ptions)
pngquant worker: `pngquant` not found; please provide proper binary or di=
sable this worker (--no-pngquant argument or `:pngquant =3D> false` throu=
gh options)
jhead worker: `jhead` not found, `jpegtran` not found; please provide pro=
per binary or disable this worker (--no-jhead argument or `:jhead =3D> fa=
lse` through options)
jpegoptim worker: `jpegoptim` not found; please provide proper binary or =
disable this worker (--no-jpegoptim argument or `:jpegoptim =3D> false` t=
hrough options)
jpegtran worker: `jpegtran` not found; please provide proper binary or di=
sable this worker (--no-jpegtran argument or `:jpegtran =3D> false` throu=
gh options)
gifsicle worker: `gifsicle` not found; please provide proper binary or di=
sable this worker (--no-gifsicle argument or `:gifsicle =3D> false` throu=
gh options)
  • Server Ubuntu 14.04.5 LTS 服务器Ubuntu 14.04.5 LTS
  • Rails 5.1.3 Rails 5.1.3
  • Ruby 2.4.1 Ruby 2.4.1
  • nginx 1.9.10 nginx 1.9.10
  • passenger 5.0.24 乘客5.0.24
  • image_optim (0.25.0) image_optim(0.25.0)
  • image_optim_pack (0.5.0.20170803 x86_64-linux) image_optim_pack(0.5.0.20170803 x86_64-linux)

tl;dr, the binaries in image_optim_pack were probably built against a newer system than the one you are trying to run it on. tl; dr,image_optim_pack中的二进制文件可能是建立在一个比你试图运行它的系统更新的系统上的。 Try finding the latest version of image_optim_pack that works on your system. 尝试查找适用于您系统的最新版本的image_optim_pack。 For me, the following versions worked: 对我来说,以下版本有效:

gem "image_optim", "~> 0.25"
gem "image_optim_pack", "= 0.2.3"

More details 更多细节

To get information on what piece is failing, run: 要获取有关哪个部分失败的信息,请运行:

$ bundle exec image_optim --info

I see something like this: 我看到这样的事情:

$ bundle exec image_optim --info
image_optim v0.26.1
config:
  verbose: true
nice: 10
threads: 4
pack: true
skip_missing_workers: true
allow_lossy: false
cache_dir:
cache_worker_digests: false
image_optim_pack: jpeg-recompress, jpegoptim, jhead, advpng, jpegtran, gifsicle, pngcrush, optipng from /path/to/gems/ruby-2.4.0/gems/image_optim_pack-0.5.0.20180419-x86_64-linux/vendor/linux-x86_64 failed
No pack for this OS and/or ARCH, check verbose output
Resolved jpegrescan 1a762f62 at /path/to/gems/ruby-2.4.0/gems/image_optim-0.26.1/vendor/jpegrescan
pngcrush worker: `pngcrush` not found; please provide proper binary or disable this worker (--no-pngcrush argument or `:pngcrush => false` through options)
pngout worker: `pngout` not found; please provide proper binary or disable this worker (--no-pngout argument or `:pngout => false` through options)
advpng worker: `advpng` not found; please provide proper binary or disable this worker (--no-advpng argument or `:advpng => false` through options)
optipng worker: `optipng` not found; please provide proper binary or disable this worker (--no-optipng argument or `:optipng => false` through options)
pngquant worker: `pngquant` not found; please provide proper binary or disable this worker (--no-pngquant argument or `:pngquant => false` through options)
jhead worker: `jhead` not found, `jpegtran` not found; please provide proper binary or disable this worker (--no-jhead argument or `:jhead => false` through options)
jpegoptim worker: `jpegoptim` not found; please provide proper binary or disable this worker (--no-jpegoptim argument or `:jpegoptim => false` through options)
jpegtran worker: `jpegtran` not found; please provide proper binary or disable this worker (--no-jpegtran argument or `:jpegtran => false` through options)
gifsicle worker: `gifsicle` not found; please provide proper binary or disable this worker (--no-gifsicle argument or `:gifsicle => false` through options)
svgo worker: `svgo` not found; please provide proper binary or disable this worker (--no-svgo argument or `:svgo => false` through options)
Workers by format:

It doesn't say why the workers failed. 它没有说工人失败的原因。 But you can run the worker binaries to find out: 但是你可以运行worker二进制文件来找出:

# Path from the error message:
$ export IMAGE_OPTIM_BIN="/path/to/gems/ruby-2.4.0/gems/image_optim_pack-0.5.0.20180419-x86_64-linux/vendor/linux-x86_64"
$ ls $IMAGE_OPTIM_BIN
advpng  gifsicle  jhead  jpegoptim  jpeg-recompress  jpegtran  libjpeg.so  libpng.so  libz.so  optipng  pngcrush  pngquant
$ $IMAGE_OPTIM_BIN/advpng
/path/to/gems/ruby-2.4.0/gems/image_optim_pack-0.5.0.20180419-x86_64-linux/vendor/linux-x86_64/advpng: /lib/libc.so.6: version `GLIBC_2.14' not found (required by /path/to/gems/ruby-2.4.0/gems/image_optim_pack-0.5.0.20180419-x86_64-linux/vendor/linux-x86_64/advpng)
/path/to/gems/ruby-2.4.0/gems/image_optim_pack-0.5.0.20180419-x86_64-linux/vendor/linux-x86_64/advpng: /lib/libc.so.6: version `GLIBC_2.14' not found (required by /path/to/gems/ruby-2.4.0/gems/image_optim_pack-0.5.0.20180419-x86_64-linux/vendor/linux-x86_64/libz.so)

I think the important part is: 我认为重要的是:

version `GLIBC_2.14' not found

I checked the version of glibc installed on my system, and it is only 2.12. 我查看了我系统上安装的glibc版本,它只有2.12。 If you are able to upgrade glibc via your system's package manager, try that first. 如果您能够通过系统的软件包管理器升级glibc,请先尝试。 If you can't upgrade glibc, then just use an older version of the gems as described above. 如果你无法升级glibc,那么只需使用旧版本的宝石,如上所述。

I had the same issue with image_optim_pack version 0.5.020170815 . 我对image_optim_pack版本0.5.020170815也有同样的问题。

Upgrading to the most recent version ( 0.5.020170831 as of now) fixed the issue for me. 升级到最新版本(截至目前为0.5.020170831 )为我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ImageOptim :: BinResolver :: Error:Bin解决错误:remote:pngout worker; 使用image_optim,image_optim_rails推送到Heroku - ImageOptim::BinResolver::Error: Bin resolving errors: remote: pngout worker; using image_optim, image_optim_rails pushing to Heroku SECRET_KEY_BASE 缺少生产错误 - SECRET_KEY_BASE missing error on production Rails 4生产中缺少Ajax_pagination gem加载图像 - Ajax_pagination gem loading image missing in Rails 4 production Rails中缺少图像404错误 - Missing image 404 error in rails 在生产中上传图像后出现Rails错误500 - Rails error 500 after image upload in production 资产中缺少文件错误:使用RAILS_ENV = production而不是Development进行预压缩 - Missing file error in asset:precompline with RAILS_ENV=production, but not development “缺少'secret_key_base`为'生产'环境”Heroku上的错误 - “Missing `secret_key_base` for 'production' environment” error on Heroku 生产中缺少Rails方法? - Rails Method missing in production? 在Heroku Cedar Stack上使用image_optim gem的libjpeg(Ruby buildpack) - libjpeg with image_optim gem on Heroku Cedar Stack (Ruby buildpack) Spree-editor 在上传图像时给出了生产错误 - Spree-editor gives the error in production while uploading image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM