le0pard/webp-ffi

Error installing on Ubuntu

ebriones14 opened this issue · 6 comments

Hello!

I am having issue installing webp-ffi gem in my ubuntu server. Please see the errors below.

I installed first the needed dependencies.

sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libwebp-dev

Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libpng12-dev' instead of 'libpng-dev'
Note, selecting 'libtiff4-dev' instead of 'libtiff-dev'
libjpeg-dev is already the newest version.
libwebp-dev is already the newest version.
libpng12-dev is already the newest version.
libtiff4-dev is already the newest version.
The following packages were automatically installed and are no longer required:
libxrandr-dev libxdamage-dev libxml2-utils libxfixes-dev gir1.2-freedesktop x11proto-xinerama-dev libxi-dev gir1.2-gtk-2.0 libopenexr-dev liblcms1-dev x11proto-randr-dev libxinerama-dev libcgraph5
libatk1.0-dev librsvg2-dev libgdk-pixbuf2.0-dev libexif-dev libjasper-dev libilmbase-dev x11proto-fixes-dev liblqr-1-0-dev x11proto-xext-dev libxt-dev libxext-dev x11proto-damage-dev gir1.2-atk-1.0
libwmf-dev libpango1.0-dev gir1.2-gdkpixbuf-2.0 libjpeg62 libxdot4 libgvpr1 gir1.2-rsvg-2.0 libxcomposite-dev libgraphviz-dev libxft-dev x11proto-composite-dev libexif12 libgtk2.0-dev libxt6 libxcursor-dev
libbz2-dev gir1.2-pango-1.0
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.

Installing the gem

gem install webp-ffi

Building native extensions. This could take a while...
ERROR: Error installing webp-ffi:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/webp-ffi-0.2.7/ext/webp_ffi
/usr/local/bin/ruby -rubygems /usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/exe/rake RUBYARCHDIR=/usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/webp-ffi-0.2.7 RUBYLIBDIR=/usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/webp-ffi-0.2.7
mkdir -p x86_64-linux
gcc -fexceptions -O -fno-omit-frame-pointer -fno-strict-aliasing -fPIC -DHAVE_PUTS=1 -DHAVE_WEBPDECODERCONFIG=1 -DHAVE_WEBPGETINFO=1 -DHAVE_STDIO_H=1 -o x86_64-linux/jpegdec.o -c ./jpegdec.c
gcc -fexceptions -O -fno-omit-frame-pointer -fno-strict-aliasing -fPIC -DHAVE_PUTS=1 -DHAVE_WEBPDECODERCONFIG=1 -DHAVE_WEBPGETINFO=1 -DHAVE_STDIO_H=1 -o x86_64-linux/pngdec.o -c ./pngdec.c
./pngdec.c: In function ‘UtilReadPNG’:
./pngdec.c:89:6: error: ‘WebPPicture’ has no member named ‘use_argb’
pic->use_argb = 1;
^
rake aborted!
Command failed with status (1): [gcc -fexceptions -O -fno-omit-frame-pointe...]
Tasks: TOP => default => x86_64-linux/libwebp_ffi.so => x86_64-linux/pngdec.o
(See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.4.0/gems/webp-ffi-0.2.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/webp-ffi-0.2.7/gem_make.out

gem_make.out

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/webp-ffi-0.2.7/ext/webp_ffi
/usr/local/bin/ruby -rubygems /usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/exe/rake RUBYARCHDIR=/usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/webp-ffi-0.2.7 RUBYLIBDIR=/usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/webp-ffi-0.2.7
mkdir -p x86_64-linux
gcc -fexceptions -O -fno-omit-frame-pointer -fno-strict-aliasing -fPIC -DHAVE_PUTS=1 -DHAVE_WEBPDECODERCONFIG=1 -DHAVE_WEBPGETINFO=1 -DHAVE_STDIO_H=1 -o x86_64-linux/jpegdec.o -c ./jpegdec.c
gcc -fexceptions -O -fno-omit-frame-pointer -fno-strict-aliasing -fPIC -DHAVE_PUTS=1 -DHAVE_WEBPDECODERCONFIG=1 -DHAVE_WEBPGETINFO=1 -DHAVE_STDIO_H=1 -o x86_64-linux/pngdec.o -c ./pngdec.c
./pngdec.c: In function ‘UtilReadPNG’:
./pngdec.c:89:6: error: ‘WebPPicture’ has no member named ‘use_argb’
pic->use_argb = 1;
^
rake aborted!
Command failed with status (1): [gcc -fexceptions -O -fno-omit-frame-pointe...]
Tasks: TOP => default => x86_64-linux/libwebp_ffi.so => x86_64-linux/pngdec.o
(See full trace by running task with --trace)
rake failed, exit code 1

Researched on Google already, but every possible solution is not working. Any idea why am I getting errors?

Thank you,
ebriones14

Webp library version should be >= 0.3.0

Check what version webp you installed

libwebp-dev

Installed: 0.1.3-2.1ubuntu1

Should this be >= 0.3.0?

I am using Ubuntu 12.04 precise.

Yes, it should be >= 0.3.0. It is written in readme: https://github.com/le0pard/webp-ffi#requirements

Ubuntu 12.04 stop getting security updates at 2017-04-28 (extended support at 2019-04). It is too old.

Is there any workaround for this issue?

Or only updating Ubuntu will solve this problem?

workaround - update OS or libwebp

Alright. Thank you very much for the prompt response!