Giter Club home page Giter Club logo

Comments (20)

toy avatar toy commented on June 12, 2024

Please run bundle exec image_optim --info and see if image_optim_pack succeeded and if bins except pngout and svgo are resolved to those provided by image_optim_pack

from image_optim_pack.

creativetags avatar creativetags commented on June 12, 2024

It gave me this:

image_optim v0.25.0
config:
  verbose: true
nice: 10
threads: 2
pack: true
skip_missing_workers: true
allow_lossy: false
cache_dir: 
cache_worker_digests: false
image_optim_pack: advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegtran, optipng, pngcrush from /home/ctgs/shared/bundle/ruby/2.4.0/gems/image_optim_pack-0.5.0.20170831-x86_64-linux/vendor/linux-x86_64 failed
No pack for this OS and/or ARCH, check verbose output
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:

from image_optim_pack.

toy avatar toy commented on June 12, 2024

A bit weird that image_optim_pack warning doesn't mention pngquant.
Can you please check if the binaries in that vendor subfolder are executable?
I have a feeling that something may be wrong with standard libraries, can you also run ldd on those binaries?

from image_optim_pack.

creativetags avatar creativetags commented on June 12, 2024

Here's the directory listing:

total 2.3M
drwxrwxr-x 2 ctgs ctgs 4.0K Sep 11 11:28 ./
drwxrwxr-x 3 ctgs ctgs 4.0K Sep 11 11:28 ../
-rwxr-xr-x 1 ctgs ctgs 344K Sep 11 11:28 advpng*
-rwxr-xr-x 1 ctgs ctgs 224K Sep 11 11:28 gifsicle*
-rwxr-xr-x 1 ctgs ctgs  77K Sep 11 11:28 jhead*
-rwxr-xr-x 1 ctgs ctgs  39K Sep 11 11:28 jpegoptim*
-rwxr-xr-x 1 ctgs ctgs 535K Sep 11 11:28 jpeg-recompress*
-rwxr-xr-x 1 ctgs ctgs  47K Sep 11 11:28 jpegtran*
-rwxr-xr-x 1 ctgs ctgs 300K Sep 11 11:28 libjpeg.so*
-rwxr-xr-x 1 ctgs ctgs 249K Sep 11 11:28 libpng.so*
-rwxr-xr-x 1 ctgs ctgs 112K Sep 11 11:28 libz.so*
-rwxr-xr-x 1 ctgs ctgs 101K Sep 11 11:28 optipng*
-rwxr-xr-x 1 ctgs ctgs 115K Sep 11 11:28 pngcrush*
-rwxr-xr-x 1 ctgs ctgs  84K Sep 11 11:28 pngquant*

ldd on any of those returns not a dynamic executable

from image_optim_pack.

toy avatar toy commented on June 12, 2024

If I understand correctly it is either caused by 64 bit binaries on 32 bit system or shared libraries problem. What does uname -i output for you?

from image_optim_pack.

creativetags avatar creativetags commented on June 12, 2024

x86_64

from image_optim_pack.

toy avatar toy commented on June 12, 2024

from image_optim_pack.

creativetags avatar creativetags commented on June 12, 2024

When I try to run one of those I just get
./jhead: No such file or directory
pngquant gives the same

from image_optim_pack.

toy avatar toy commented on June 12, 2024

from image_optim_pack.

creativetags avatar creativetags commented on June 12, 2024

Yeah, it's weird. I did the same using the full path. I think there might be something going on with the 64 vs 32 bit thing. I might have a 64-bit kernel and 32-bit environment? If I run file /usr/bin/file I get /usr/bin/file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0428d646fd1bffff284d958f48e0d76a8f90f3e1, stripped

from image_optim_pack.

toy avatar toy commented on June 12, 2024

from image_optim_pack.

creativetags avatar creativetags commented on June 12, 2024

Sure, where do I find those? I can't see them in your repos

from image_optim_pack.

toy avatar toy commented on June 12, 2024

Every version of gem has variants with different platform. It seems adding platform option in gemfile works: gem 'image_optim_pack', platform: 'ruby'. Or you can remove other versions of gem and manually install platform specific one: gem install image_optim_pack --platform=i686-linux and bundle should pick that one.
Also it is interesting what does gem environment output in section "RUBYGEMS PLATFORMS" on your server and what does bundle platform output (the values are probably related)? It seems that your issue arrises from the fact that rubygems expect your system to be 64 bit, but it is not.

from image_optim_pack.

creativetags avatar creativetags commented on June 12, 2024

Thanks for your help. I haven't managed to get it to work and am probably going to give up as it's taking too much time. I'm contemplating reinstalling Ubuntu to get everything 64-bit for simplicity in the future.

gem environment
RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux

bundle platform
Your platform is: x86_64-linux

from image_optim_pack.

toy avatar toy commented on June 12, 2024

When creating platform specific gems I knew that there may be some problems, as too my knowledge bundler doesn't give any way of selecting which platform specific version to use, but I wanted to considerably reduce the gem size.
Normally if you have some gem already installed (and gem command allows you to specify platform) and bundler is allowed to use system gems, it should use that version. But it seems your environment is tricky for rubygems/bundler.

from image_optim_pack.

sffc avatar sffc commented on June 12, 2024

I encountered this error, too. I replied to the StackOverflow question:

https://stackoverflow.com/a/50695884/1407170

In my case, the issue was that the binaries in image_optim_pack required a newer version of glibc than was available on my system. My workaround (short up upgrading my Linux distribution, which I plan to do soon) was to install the latest version of image_optim_pack that worked, which appeared to be version 0.2.3. (The 0.3 chain could also work; didn't test between 0.2.3 and 0.5.0)

from image_optim_pack.

toy avatar toy commented on June 12, 2024

@sffc Last compatible version should be 0.3.1.20170318 as I've switched from centos to ubuntu in be36a52 and rebuilt all binaries in 0cdae11 before releasing 0.4.0. I'll check what can be done about required glibc version.

from image_optim_pack.

toy avatar toy commented on June 12, 2024

@sffc Please try version on branch centos-6.9.

from image_optim_pack.

sffc avatar sffc commented on June 12, 2024

I put this in my Gemfile and then ran bundle install:

gem "image_optim_pack", :git => "git://github.com/toy/image_optim_pack.git", :branch => "centos-6.9"

Output of 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: all bins from /path/to/.rvm/gems/ruby-2.4.0/bundler/gems/image_optim_pack-f868817156b1/vendor/linux-x86_64 worked
Resolved pngcrush 1.8.13 at /path/to/.rvm/gems/ruby-2.4.0/bundler/gems/image_optim_pack-f868817156b1/vendor/linux-x86_64/pngcrush
Resolved advpng 2.1 at /path/to/.rvm/gems/ruby-2.4.0/bundler/gems/image_optim_pack-f868817156b1/vendor/linux-x86_64/advpng
Resolved optipng 0.7.7 at /path/to/.rvm/gems/ruby-2.4.0/bundler/gems/image_optim_pack-f868817156b1/vendor/linux-x86_64/optipng
Resolved pngquant 2.12.0 at /path/to/.rvm/gems/ruby-2.4.0/bundler/gems/image_optim_pack-f868817156b1/vendor/linux-x86_64/pngquant
Resolved jhead 3.00 at /path/to/.rvm/gems/ruby-2.4.0/bundler/gems/image_optim_pack-f868817156b1/vendor/linux-x86_64/jhead
Resolved jpegtran 9c at /path/to/.rvm/gems/ruby-2.4.0/bundler/gems/image_optim_pack-f868817156b1/vendor/linux-x86_64/jpegtran
Resolved jpegoptim 1.4.6 at /path/to/.rvm/gems/ruby-2.4.0/bundler/gems/image_optim_pack-f868817156b1/vendor/linux-x86_64/jpegoptim
Resolved jpegrescan 1a762f62 at /path/to/.rvm/gems/ruby-2.4.0/gems/image_optim-0.26.1/vendor/jpegrescan
Resolved gifsicle 1.91 at /path/to/.rvm/gems/ruby-2.4.0/bundler/gems/image_optim_pack-f868817156b1/vendor/linux-x86_64/gifsicle
pngout worker: `pngout` not found; please provide proper binary or disable this worker (--no-pngout argument or `:pngout => 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:
( ... )

So it looks like the branch works. 😃 Thanks for keeping support for older OSs!

from image_optim_pack.

toy avatar toy commented on June 12, 2024

@sffc v0.5.1 is out

from image_optim_pack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.