Installing rmagick gem on ubuntu 14.04
Asked Answered
U

7

13

I'm trying to deploy an app on OpsWorks, but there are problems with installing rmagick gem. I have the following OS packages:

libmagickwand-dev imagemagick libmagickcore-dev

Below is the log file with errors during deployment:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 0.0.0. Can't find Magick-config in /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

*** 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=/usr/local/bin/ruby

extconf failed, exit code 1

Gem files will remain installed in /home/deploy/.bundler/myapp/ruby/2.1.0/gems/rmagick-2.13.3 for inspection.
Results logged to /home/deploy/.bundler/myapp/ruby/2.1.0/extensions/x86_64-linux/2.1.0/rmagick-2.13.3/gem_make.out
An error occurred while installing rmagick (2.13.3), and Bundler cannot
continue.
Make sure that `gem install rmagick -v '2.13.3'` succeeds before bundling.
STDERR:
---- End output of sudo su - deploy -c 'cd /srv/www/myapp/releases/20140929182350 && /usr/local/bin/bundle install --path /home/deploy/.bundler/myapp --without=test development' 2>&1 ----
Ran sudo su - deploy -c 'cd /srv/www/myapp/releases/20140929182350 && /usr/local/bin/bundle install --path /home/deploy/.bundler/myapp --without=test development' 2>&1 returned 5
[2014-09-29T18:24:08+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Understudy answered 29/9, 2014 at 18:34 Comment(0)
H
26

In your shell, run the following command:

apt-get install libmagickwand-dev
Hafer answered 29/9, 2014 at 19:14 Comment(1)
More specifically, make sure that command gets run on the machine you're trying to deploy to; not just your local development machine. I guess you need to add a chef "package" resource for it.Eunuchoidism
S
8

I had the same problem after upgrading ubuntu to 15.05, some how the Magick-config file is no longer in my PATH. To fix this I first found the location of Magick-config

sudo find / -name "Magick-config"

which was /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config then I added it to the path. Bundle succeeded afterwards.

Syrian answered 23/4, 2015 at 21:58 Comment(1)
I've been struggling with the same problem on Ubuntu 15 all morning. This finally worked, thanks.Summand
B
3
sudo apt-get install libmagickwand5 libmagickwand-dev
gem install rmagick -v 2.13.3
Burrus answered 7/1, 2015 at 9:40 Comment(0)
J
3

Install Imagemagick-dev libraries

Ubuntu systems: sudo apt-get install libmagickwand-dev

RHEL systems: yum install ImageMagick-devel

Mac: brew install imagemagick

Justitia answered 9/6, 2015 at 10:3 Comment(0)
L
2

In Ubuntu 14.04 I also needed to install the libgmp-dev library to get working the newer rmagick 2.15.4 version:

sudo apt-get install libgmp-dev

Hope this helps!

Lacerate answered 27/9, 2015 at 17:58 Comment(0)
S
0

to fix it permanently we could just do:

ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
Surrebutter answered 11/10, 2016 at 14:25 Comment(0)
I
0

First of all we need to search configuration

sudo find / -name "Magick-config"

You will get output something like this:

/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config

Now you just need to setup bin location in your environment by using this:

PATH=$PATH:/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/

Don't forget to remove Magick-config from end of line.

Idiom answered 16/10, 2017 at 12:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.