Gem install rmagick requires imagemagick

I was trying to just do a CLI short (very short) script with
activerecord
and sqlite3, and in tracing back some errors ended at:

thufir@dur:~$
thufir@dur:~$ gem search rmagic -r

*** REMOTE GEMS ***

compass-rmagick-engine (0.0.2)
hornetseye-rmagick (0.5.0)
jdeerhake-compass-rmagick-engine (0.0.3)
rdp-rmagick (0.0.0)
rmagick (2.13.1)
rmagick4j (0.3.7, 0.3.4 java)
rmagick_captcha (0.6.2)
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$ gem install rmagick --no-rdoc --no-ri
Building native extensions. This could take a while…
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

    /home/thufir/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb

checking for Ruby version >= 1.8.5… yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
checking for gcc… yes
checking for Magick-config… no
Can’t install RMagick 2.13.1. Can’t find Magick-config in /home/
thufir/.rvm/gems/ruby-1.9.3-p125/bin:/home/thufir/.rvm/gems/ruby-1.9.3-
p125@global/bin:/home/thufir/.rvm/rubies/ruby-1.9.3-p125/bin:/opt/
ActiveTcl-8.5/bin:/home/thufir/.rvm/gems/ruby-1.9.3-p125/bin:/home/
thufir/.rvm/gems/ruby-1.9.3-p125@global/bin:/home/thufir/.rvm/rubies/
ruby-1.9.3-p125/bin:/home/thufir/.rvm/bin:/usr/lib/lightdm/lightdm:/usr/
local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/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
–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=/home/thufir/.rvm/rubies/ruby-1.9.3-p125/bin/ruby

Gem files will remain installed in
/home/thufir/.rvm/gems/ruby-1.9.3-p125/
gems/rmagick-2.13.1 for inspection.
Results logged to /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/
rmagick-2.13.1/ext/RMagick/gem_make.out
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$ type rvm | head -1
rvm is a function
thufir@dur:~$
thufir@dur:~$ rvm --version

rvm 1.10.3 by Wayne E. Seguin [email protected], Michal P.
[email protected] [https://rvm.beginrescueend.com/]

thufir@dur:~$
thufir@dur:~$ ruby --version
ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]
thufir@dur:~$
thufir@dur:~$ gem --version
1.8.19
thufir@dur:~$

Now, it looks like I just use apt-get to install imagemagick on Ubuntu
11.10, but that seems off, in that gems should be system independent, to
my understanding.

This gem requires that I install a non-gem piece of software?

thanks,

Thufir

On Thu, 22 Mar 2012 21:44:18 +0900, thufir wrote:

thufir@dur:~$ gem install rmagick --no-rdoc --no-ri Building native
extensions. This could take a while… ERROR: Error installing
rmagick:
ERROR: Failed to build gem native extension.

Similar but different result for another gem:

thufir@dur:~$
thufir@dur:~$
thufir@dur:~$ whereis curl
curl: /usr/bin/curl /usr/share/man/man1/curl.1.gz
thufir@dur:~$
thufir@dur:~$ gem install feedzirra --no-rdoc --no-ri
Building native extensions. This could take a while…
ERROR: Error installing feedzirra:
ERROR: Failed to build gem native extension.

    /home/thufir/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb

checking for curl-config… no
checking for main() in -lcurl… no
*** 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
–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=/home/thufir/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
–with-curl-dir
–without-curl-dir
–with-curl-include
–without-curl-include=${curl-dir}/include
–with-curl-lib
–without-curl-lib=${curl-dir}/lib
–with-curllib
–without-curllib
extconf.rb:23:in `’: Can’t find libcurl or curl/curl.h
(RuntimeError)

Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
options to extconf.

Gem files will remain installed in
/home/thufir/.rvm/gems/ruby-1.9.3-p125/
gems/curb-0.7.18 for inspection.
Results logged to
/home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/curb-0.7.18/
ext/gem_make.out
thufir@dur:~$
thufir@dur:~$

Sigh. Do I have to re-install ruby or something? Or are these gems the
problem? Seems more likely that my computer is, though.

-Thufir

sudo apt-get install libmagickcore-dev libcurl4-dev

Thanks, guys. Almost seventy packages getting pulled in! Hopefully,
that will fix it.

On Thu, Mar 22, 2012 at 5:44 AM, thufir [email protected] wrote:

Now, it looks like I just use apt-get to install imagemagick on Ubuntu
11.10, but that seems off, in that gems should be system independent, to
my understanding.

This gem requires that I install a non-gem piece of software?

If the purpose of a gem is to interface with another program, then
yes, you need that program (or typically some of it’s source libraries)
on your system.

“Building native extensions.” is a pretty good clue that a gem isn’t
pure Ruby, e.g. “system independent” :slight_smile:

In this case, perhaps this will help:
http://rmagick.rubyforge.org/install-faq.html

HTH,

Success!

thufir@dur:~$
thufir@dur:~$ gem install rmagick --no-rdoc --no-ri
Building native extensions. This could take a while…
Successfully installed rmagick-2.13.1
1 gem installed
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$ sudo find / -type f -name “MagickWand.h”
[sudo] password for thufir:
/usr/include/ImageMagick/wand/MagickWand.h
thufir@dur:~$

I also had to install ImageMagick itself for MagicWand.h which was
holding things up. Basically, anything with “magick” I installed.

Kinda forget why I wanted that gem, now, LOL. Something to do with
ActiveRecord.

-Thufir

Not working …! in Ubuntu 13.04

sudo apt-get install imagemagick
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package imagemagick is not available, but is referred to by another
package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘imagemagick’ has no installation candidate

$sudo apt-get install imagemagick

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package imagemagick is not available, but is referred to by another
package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘imagemagick’ has no installation candidate
anil@anil-System-Product-Name:~$ sudo apt-get install libmagickcore-dev
libcurl4-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘libcurl4-openssl-dev’ instead of ‘libcurl4-dev’
E: Unable to locate package libmagickcore-dev
anil@anil-System-Product-Name:~$ gem install rmagick --no-rdoc --no-ri
Building native extensions. This could take a while…
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

/home/anil/.rvm/rubies/ruby-2.0.0-p481/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/heroku/bin:/home/anil/.rvm/gems/ruby-2.0.0-p481/bin:/home/anil/.rvm/gems/ruby-2.0.0-p481@global/bin:/home/anil/.rvm/rubies/ruby-2.0.0-p481/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/anil/.rvm/bin:/home/anil/.rvm/bin:/home/anil/.rvm/bin

*** 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=/home/anil/.rvm/rubies/ruby-2.0.0-p481/bin/ruby

extconf failed, exit code 1

Gem files will remain installed in
/home/anil/.rvm/gems/ruby-2.0.0-p481/gems/rmagick-2.13.3 for inspection.
Results logged to
/home/anil/.rvm/gems/ruby-2.0.0-p481/extensions/x86-linux/2.0.0/rmagick-2.13.3/gem_make.out