Installing rmagick on Ubuntu

孤街浪徒 提交于 2019-11-27 06:05:57
gcahill

Install the packages imagemagick and libmagickwand-dev (or libmagick9-dev). You should then be able to install the Rmagick Gem.

sudo apt-get install imagemagick libmagickwand-dev

If not, you are missing ruby related development packages like build-essential and ruby1.8-dev. If that's the case, a generic "ubuntu install ruby 1.8" query in google should sort you out.

You don't need a lot of the other junk in these answers, just:

sudo apt-get install libmagickwand-dev

On Ubuntu 12.04 libmagick9-dev is gone. graphicsmagick-libmagick-dev-compat should be used instead.

apt-get install graphicsmagick-libmagick-dev-compat

On Ubuntu 15.04, what solved it for me was to remove all previous *magick installations, reinstall required packages and then symlink the config file:

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
gem install rmagick
bapu

In Ubuntu 14.04


Below code is worked for me

sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev

Then,

gem install rmagick

On Ubuntu 12.0.4.2 sudo apt-get install libmagickwand-dev libmagickcore-dev libmagickcore4-extra libgraphviz-dev libgvc5 worked for me.

graphicsmagick-libmagick-dev-compat installed but didn't include the header files so rmagick wouldn't compile.

Please note, you need to remove graphicsmagick-libmagick-dev-compat before running the command above.

this worked for me...

sudo apt-get install graphicsmagick-libmagick-dev-compat libmagickwand-dev 

gem install rmagick

...

Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed

(ubuntu 12.0.4 64bit)

You got message extconf.rb:1:in 'require': no such file to load -- mkmf (LoadError) because package ruby1.8-dev isn't installed. Install it (sudo apt-get install ruby1.8-dev) and try again.

In Ubuntu 13.10

This code worked for me

sudo apt-get install graphicsmagick-libmagick-dev-compat libmagickwand-dev

gem install rmagick

To get bundle to stop failing on ubuntu 12.04.

apt-get install graphicsmagick-libmagick-dev-compat libmagickwand-dev

This is my gemfile

gem 'rmagick' 
gem 'mini_magick' 

On Ubuntu, you can run:

sudo apt-get install libmagickwand-dev

On Centos, you can run:

sudo yum install gcc ImageMagick-devel make which

Then install

gem install rmagick

If you want to try installing the native deb package instead of the gem, be aware that the librmagick-ruby was broken on Ubuntu 10.04 until just very recently:

https://bugs.launchpad.net/ubuntu/+source/librmagick-ruby/+bug/518122

See comment #17 in particular. I believe this has already been fixed so now apt-get install librmagick-ruby might "just work". Otherwise here's how to build it yourself from source

$ cd /usr/src
$ sudo apt-get build-dep librmagick-ruby
$ sudo apt-get source librmagick-ruby
$ cd librmagick-ruby-2.11.1
$ sudo dch -i
(add changelog entry)
$ sudo dpkg-buildpackage
$ cd ..
$ sudo dpkg -i librmagick-ruby*.deb

In ubuntu 16.04.3:

This i worked:

sudo apt install imagemagick imagemagick-6.q16

It means this installed imagemagick then you can run RMagick.

If you are using Linux then simply run these commands.

 sudo apt-get install imagemagick libmagickwand-dev

and then

 bundle install

Hope this will resolve your issue.

And if you are using mac then simply run following commands

First of all unlink your installed imagemagick which was not properly installed in latest mac high sierra by using.

 brew unlink imagemagick

then install latest imagemagic6 using below command

 brew install imagemagick@6 && brew link imagemagick@6 --force

Then install gem rmagick using below command

 gem install rmagick 

 bundle install

It will work perfectly fine.

Follow below 3 steps proven on UBUNTU 16.04

sudo apt-get install build-essential imagemagick libmagickwand-dev

#In .bashrc or .bash_profile add below code. Just check the ImageMagick dir name.
export PATH="/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16:$PATH"
gem install rmagic #Install Gem
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!