3

Trying to install pdfbeads on Ubuntu LTS 16.04 with the command $ gem install pdfbeads I'm getting the error message "ERROR: Can't install RMagick 4.0.0. Can't find ImageMagick with pkg-config"

Below between the separators is the corresponding stdout.


$ sudo gem install pdfbeads

Building native extensions. This could take a while... Successfully installed nokogiri-1.10.7 Building native extensions. This could take a while... ERROR: Error installing pdfbeads: ERROR: Failed to build gem native extension.

current directory: /home/enemem/.gem/gems/rmagick-4.0.0/ext/RMagick

/snap/bin/ruby -I /snap/ruby/172/lib/ruby/2.7.0 -r ./siteconf20200127-10722-yuiix4.rb extconf.rb checking for brew... no checking for pacman... no checking for gcc... yes checking for pkg-config... yes

ERROR: Can't install RMagick 4.0.0. Can't find ImageMagick with pkg-config

* extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/snap/ruby/172/bin/$(RUBY_BASE_NAME)


Checked the mkmf.log file but it containe the same info, verbatim.

Then I tried to use the command

$ pkg-config --modversion imagemagick

and got this output:


Package imagemagick was not found in the pkg-config search path. Perhaps you should add the directory containing `imagemagick.pc' to the PKG_CONFIG_PATH environment variable No package 'imagemagick' found


Following up on this suggestion I tried to find where imagemagick is on my system by running:

$ sudo locate -b '\imagemagick*'

and got the output:


/usr/lib/mime/packages/imagemagick /usr/share/app-install/desktop/imagemagick-6.q16:display-im6.q16.desktop /usr/share/app-install/desktop/imagemagick:display-im6.desktop /usr/share/bug/imagemagick /usr/share/cups/ppdc/imagemagick.defs /usr/share/doc/imagemagick /usr/share/doc/imagemagick-6.q16 /usr/share/doc/imagemagick-common /usr/share/menu/imagemagick /var/lib/app-info/icons/ubuntu-xenial-main/64x64/imagemagick-6.q16_display-im6.q16.png /var/lib/app-info/icons/ubuntu-xenial-main/64x64/imagemagick_display-im6.q16.png /var/lib/app-info/icons/ubuntu-xenial-security-main/64x64/imagemagick-6.q16_display-im6.q16.png /var/lib/app-info/icons/ubuntu-xenial-security-main/64x64/imagemagick_display-im6.q16.png /var/lib/app-info/icons/ubuntu-xenial-updates-main/64x64/imagemagick-6.q16_display-im6.q16.png /var/lib/app-info/icons/ubuntu-xenial-updates-main/64x64/imagemagick_display-im6.q16.png /var/lib/dpkg/info/imagemagick-6.q16.list /var/lib/dpkg/info/imagemagick-6.q16.md5sums /var/lib/dpkg/info/imagemagick-common.conffiles /var/lib/dpkg/info/imagemagick-common.list /var/lib/dpkg/info/imagemagick-common.md5sums /var/lib/dpkg/info/imagemagick-common.postinst /var/lib/dpkg/info/imagemagick-common.postrm /var/lib/dpkg/info/imagemagick-common.preinst /var/lib/dpkg/info/imagemagick.list /var/lib/dpkg/info/imagemagick.md5sums /var/lib/dpkg/info/imagemagick.postinst /var/lib/dpkg/info/imagemagick.postrm /var/lib/dpkg/info/imagemagick.prerm


Version of the imagemagick package on my system is 6.8.9.9


$ sudo apt search ImageMagick | grep installed

imagemagick/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed] imagemagick-6.q16/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed] imagemagick-common/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8:6.8.9.9-7ubuntu5.15 all [installed] libgraphicsmagick++-q16-12/xenial-updates,xenial-security,now 1.3.23-1ubuntu0.5 amd64 [installed,automatic] libgraphicsmagick-q16-3/xenial-updates,xenial-security,now 1.3.23-1ubuntu0.5 amd64 [installed,automatic] libimage-magick-perl/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8:6.8.9.9-7ubuntu5.15 all [installed,automatic] libimage-magick-q16-perl/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed,automatic] libmagick++-6.q16-5v5/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed,automatic] libmagickcore-6.q16-2/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed] libmagickwand-6.q16-2/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed] perlmagick/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8:6.8.9.9-7ubuntu5.15 all [installed,automatic]


Can anyone help?

5

ERROR: Can't install RMagick 4.0.0. Can't find ImageMagick with pkg-config

EDIT : Please install libmagickcore-6.q16-dev (8:6.8.9.9-7ubuntu5.15), which is the development files for your installed "imagemagick (8:6.8.9.9-7ubuntu5.15)" : /usr/lib/x86_64-linux-gnu/pkgconfig/ImageMagick.pc, etc. etc. files.

https://packages.ubuntu.com/xenial-updates/libmagickcore-6.q16-dev >>> https://packages.ubuntu.com/xenial-updates/amd64/libmagickcore-6.q16-dev/filelist

May be you have to uninstall the older version graphicsmagick-libmagick-dev-compat and the dependency libgraphicsmagick1-dev.

| improve this answer | |
  • Thanks, that was quite helpful, that seems to be the missing piece. – marinnen128 Jan 27 at 14:04
  • However, standard version that I get by running sudo apt install graphicsmagick-libmagick-dev-compat is 1.3.23 which is too old - now I'm getting the error "ERROR: Can't install RMagick 4.0.0. You must have ImageMagick 6.7.7 or later." Please advise how to go about getting the later version. Thanks. – marinnen128 Jan 27 at 14:09
  • Sorry, graphicsmagick-libmagick-dev-compat is an older version. Please see my edited answer. – Knud Larsen Jan 27 at 14:57
  • Thanks, that did the job. Greatly appreciated. – marinnen128 Jan 27 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.