Skip to content

Instantly share code, notes, and snippets.

@ryderstorm
Last active May 17, 2023 00:28
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
  • Save ryderstorm/e3bc3ffc2903adc6f9bc0fe822af76f0 to your computer and use it in GitHub Desktop.
Save ryderstorm/e3bc3ffc2903adc6f9bc0fe822af76f0 to your computer and use it in GitHub Desktop.
Installing rmagick gem on Ubuntu 16.04
# the instructions from here: https://stackoverflow.com/questions/3704919/installing-rmagick-on-ubuntu/31089915#31089915
# worked, but only after I added in line 8
sudo apt-get purge graphicsmagick graphicsmagick-dbg imagemagick-common imagemagick imagemagick-6.q16 libmagickcore-6-headers libmagickwand-dev graphicsmagick-libmagick-dev-compat
sudo apt-get autoremove
sudo apt-get install imagemagick libmagickwand-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
gem install rmagick
@tjai89
Copy link

tjai89 commented Apr 2, 2018

Thanks!

@kakada
Copy link

kakada commented May 25, 2018

Work like a charm! thanks.

@creativesoulexplr
Copy link

Its still not working for me. Giving error
The following packages have unmet dependencies:
libmagickwand-dev : Depends: libmagickwand-6.q16-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

@gnoshme
Copy link

gnoshme commented Jul 5, 2018

@dinesh100ni I had exactly the same issue as you. Full disclaimer I'm not 100% sure what's going on here, and what was going on behind the scenes, but I think it was related to the libraries that had been installed by GIMP 2.9.9 developer edition but the solution was to use sudo aptitude install libmagickwand-6.q16-dev. (you might have to sudo apt-get install aptitude). For me it was the second suggestion (reached by hitting "n") that worked.. the first one didn't actually do anything. The second one downgraded some of the GIMP 2.9.9 files which I don't care about as I'm using the flatpak installed GIMP 2.10. After that I could install libmagickwand-dev

@wellington1993
Copy link

Thanks!

@shobhitvdb
Copy link

yesss! it works

@teelu
Copy link

teelu commented Dec 23, 2018

Thanks!

@volonterx
Copy link

Thanks! On Ubuntu 18.10 line with export PKG_CONFIG_PATH was the key.

@titocru
Copy link

titocru commented Feb 6, 2019

Thank you very much!!! It works perfectly

@pratikganvir
Copy link

Thanks!

@leobene
Copy link

leobene commented Apr 3, 2019

Thanks!

@salmagomaa
Copy link

Thank you!

@dinhngochien
Copy link

that worked, thanks

@mdorfin
Copy link

mdorfin commented Mar 12, 2020

Thanks! :)

@volonterx
Copy link

Ubuntu 20.04, rmagick 2.13.2:
I did:

sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.10/bin-Q16/Magick-config /usr/bin/Magick-config
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
sudo apt-get install libmagickwand-dev imagemagick

@pkmbackdev
Copy link

@dinesh100ni I had exactly the same issue as you. Full disclaimer I'm not 100% sure what's going on here, and what was going on behind the scenes, but I think it was related to the libraries that had been installed by GIMP 2.9.9 developer edition but the solution was to use sudo aptitude install libmagickwand-6.q16-dev. (you might have to sudo apt-get install aptitude). For me it was the second suggestion (reached by hitting "n") that worked.. the first one didn't actually do anything. The second one downgraded some of the GIMP 2.9.9 files which I don't care about as I'm using the flatpak installed GIMP 2.10. After that I could install libmagickwand-dev

Thanks Its Working

@ryderstorm
Copy link
Author

Just ran into a similar problem trying to install it on Arch Linux:

checking for brew... yes
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found


ERROR: Can't install RMagick 4.2.4.
Can't find the ImageMagick library or one of the dependent libraries.
Check the mkmf.log file for more detailed information.

This was the solution:

export PKG_CONFIG_PATH=/usr/lib/pkgconfig
gem install rmagick

I got the path from here: https://archlinux.org/packages/extra/x86_64/imagemagick/files/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment