Can't install RMagick 2.13.1. Can't find Magick-config - ruby-on-rails

$ gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/XXXXXXX/.rvm/rubies/ruby-1.9.2-p180/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 2.13.1. Can't find Magick-config in /Users/XXXXXXX/.rvm/gems/ruby-1.9.2-p180/bin:/Users/XXXXXXX/.rvm/gems/ruby-1.9.2-p180#global/bin:/Users/XXXXXXX/.rvm/rubies/ruby-1.9.2-p180/bin:/Users/XXXXXXX/.rvm/bin:/Users/XXXXXXX/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/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=/Users/XXXXXXX/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
Gem files will remain installed in /Users/XXXXXXX/.rvm/gems/ruby-1.9.2-p180/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/XXXXXXX/.rvm/gems/ruby-1.9.2-p180/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
But when I do this:
$ locate Magick-config
/opt/local/bin/Magick-config
/opt/local/share/man/man1/Magick-config.1.gz
/opt/local/var/macports/software/ImageMagick/6.6.4-9_0+q16/opt/local/bin/Magick-config
/opt/local/var/macports/software/ImageMagick/6.6.4-9_0+q16/opt/local/share/man/man1/Magick-config.1.gz
/opt/local/var/macports/software/ImageMagick/6.6.5-0_0+q16/opt/local/bin/Magick-config
/opt/local/var/macports/software/ImageMagick/6.6.5-0_0+q16/opt/local/share/man/man1/Magick-config.1.gz
Any ideas?

command: sudo apt-get install libmagickwand-dev

It isn't quite the answer to the question, but the recommended way of installing Imagemagick and Rmagick on Mac is through homebrew. It's the only way I could get Imagemagick and Rmagick playing nicely together on Mac.

For Ubuntu (11.10+) try installing the libmagick++-dev package.
For other Linux distributions, try installing the libmagick-dev package.

For my case, I am installing it on Ubuntu/Linaro 4.5.2-8ubuntu3, got same error, tried to installed the following two package suites and it worked, maybe either one of them:
sudo apt-get install graphicsmagick-libmagick-dev-compat
sudo apt-get install libmagickwand-dev

On mac, after
brew install imagemagick
Don't forget to link dylibs with:
brew link imagemagick

I had to transfer an old application to a debian stretch server.
The used ruby version was 2.0.x.
imagemagick was installed including libmagickwand-dev.
Trying to install rmagick 2.13.2 failed.
I had to upgrade the rmagick verion (patched my Gemfile.lock) to use rmagick 2.16.0, the last version supporting ruby 2.0.

Related

Can't install RMagick 4.2.3

I'm running Debian WSL 2 and I cannot install any version of RMagick.
I installed imagemagick#6 via homebrew and after installation I saw following:
imagemagick#6 is keg-only, which means it was not symlinked into /home/linuxbrew/.linuxbrew,
because this is an alternate version of another formula.
If you need to have imagemagick#6 first in your PATH, run:
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/imagemagick#6/bin:$PATH"' >> ~/.zshrc
For compilers to find imagemagick#6 you may need to set:
export LDFLAGS="-L/home/linuxbrew/.linuxbrew/opt/imagemagick#6/lib"
export CPPFLAGS="-I/home/linuxbrew/.linuxbrew/opt/imagemagick#6/include"
For pkg-config to find imagemagick#6 you may need to set:
export PKG_CONFIG_PATH="/home/linuxbrew/.linuxbrew/opt/imagemagick#6/lib/pkgconfig"
I followed all the instructions above
then I tried to install RMagick via gem install rmagick -v '4.1.2' --source 'https://rubygems.org/'
and got output:
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/rmagick-4.1.2/ext/RMagick
/home/ketch/.asdf/installs/ruby/2.7.1/bin/ruby -I /home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0 -r ./siteconf20211106-21975-1odkmjc.rb extconf.rb
checking for brew... yes
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... yes
ERROR: Can't install RMagick 4.1.2. 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=/home/ketch/.asdf/installs/ruby/2.7.1/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/rmagick-4.1.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/rmagick-4.1.2 for inspection.
Results logged to /home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/rmagick-4.1.2/gem_make.out
I tried to install rmagick on my WSL debian, WSL ubuntu, and on Manjaro through virtual machine, everytime the same error

Error while bundle install for idn-ruby

I have twitter-text gem in my application.
When I do a bundle install I am getting the below error.
Need to solve it on high priority.
I also went to the github page https://github.com/twitter/twitter-text/issues/225
but could not find a solution there.
I tried to install directly using the line below but got the same error.
gem install idn-ruby -v '0.1.0'
Error
Fetching idn-ruby 0.1.0
Installing idn-ruby 0.1.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/inuscg/.rvm/gems/ruby-2.3.0#idt-two/gems/idn-ruby-0.1.0/ext
/home/inuscg/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20180427-13217-1wpq9sy.rb extconf.rb
checking for main() in -lidn... no
ERROR: could not find idn library!
Please install the GNU IDN library or alternatively specify at least one
of the following options if the library can only be found in a non-standard
location:
--with-idn-dir=/path/to/non/standard/location
or
--with-idn-lib=/path/to/non/standard/location/lib
--with-idn-include=/path/to/non/standard/location/include
*** 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/inuscg/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
--with-idn-dir
--without-idn-dir
--with-idn-include
--without-idn-include=${idn-dir}/include
--with-idn-lib
--without-idn-lib=${idn-dir}/lib
--with-idnlib
--without-idnlib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/inuscg/.rvm/gems/ruby-2.3.0#idt-two/extensions/x86_64-linux/2.3.0/idn-ruby-0.1.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/inuscg/.rvm/gems/ruby-2.3.0#idt-two/gems/idn-ruby-0.1.0 for inspection.
Results logged to /home/inuscg/.rvm/gems/ruby-2.3.0#idt-two/extensions/x86_64-linux/2.3.0/idn-ruby-0.1.0/gem_make.out
An error occurred while installing idn-ruby (0.1.0), and Bundler cannot continue.
Make sure that `gem install idn-ruby -v '0.1.0'` succeeds before bundling.
In Gemfile:
twitter-text was resolved to 2.1.0, which depends on
idn-ruby
Thank you in advance
As per the error show in logs
ERROR: could not find idn library!. idn library is required to install twitter text. Try to install that first and then install the gem. Try with
sudo apt-get install libldap2-dev
sudo apt-get install libidn11-dev
Hope this solves your problem.
For mac:
brew install libidn
On a Mac, you can do:
$ brew install libidn
If you're using Mac OS, then here's how to install libidn:
$ brew install libidn
On Centos 7 I had to install libidn-devel via yum install libidn-devel
If you are using Windows and facing same error, then try
Instruction for Windows
Get the appropriate build of GNU LibIDN Library from here
Unpack it where you prefer (e.g. c:\tmp\libs\libidn)
Add option to bundler config
BUNDLE_BUILD__IDN-RUBY: "--with-idn-dir=C:/tmp/libs/libidn/"
Launch bundler install
As for me I used libidn-1.33-win64.zip package
You're required to install LibIDN beforehand, since the gem is just ruby bindings for it.
Requirements
GNU LibIDN Library
Rake to run the tests and generate the documentation
RubyGems to produce a Gem package
Ruby 1.9.1 or above. Patches welcome to make this work in 1.8.7
The specific download method would depend on your OS, but if it's Ubuntu, try sudo apt-get install libidn

I'm trying to install OpenGraph gem in ruby

I've searched entire web looking for a way to get over this error. But it won't budge. I installed all the libraries and dependencies according to my knowledge even uninstalled ruby and nokogiri and reinstalled again. But this error remains here.
Gem files will remain installed in /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/nokogiri-1.4.7 for inspection.
Results logged to /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/nokogiri-1.4.7/gem_make.out
This is from the gem_make.out log file from this location -> /.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/nokogiri-1.4.7/gem_make.out
ERROR: Error installing opengraph:
ERROR: Failed to build gem native extension.
current directory: /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/nokogiri-1.4.7/ext/nokogiri
/home/$User/.rbenv/versions/2.4.2/bin/ruby -r ./siteconf20171125-15877-nibcps.rb extconf.rb --with-nokogiri-dir=/home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/
*** 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/$User/.rbenv/versions/2.4.2/bin/$(RUBY_BASE_NAME)
extconf.rb:10:in `<main>': uninitialized constant Config (NameError)
Did you mean? RbConfig
CONFIG
extconf failed, exit code 1
I'd be very thankful to you if you could tell me what's wrong with it. Is it a bug in OpenGraph.
P.S: I'm not using opengraph_parser because it has a fallback method. I need opengraph gem because I need to catch the exception.
It's not opengraph, but rather nokogiri.
Nokogiri is a dependency for opengraph.
https://rubygems.org/gems/opengraph/versions/0.0.4
So, it must be related on your machine not having the dependencies needed to support nokogiri (libxml2).
Install these dependencies on your machine (assuming your on Debian/Ubuntu):
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
Fedora/Red Hat/CentOS:
sudo yum install -y gcc ruby-devel zlib-devel
sudo yum install -y rubygem-nokogiri (alternative)
Then try installing nokogiri by gem install nokogiri
For other variants, or OS:
http://www.nokogiri.org/tutorials/installing_nokogiri.html
For Fedora 26:
Until further notice, install nokogiri version < 1.8

rvm install 1.9.3 leading to ImageMagick installation issue

I was using Ruby 1.9.2 for my RoR 3.2.11 project
All worked fine until I had to upgrade to Ruby 1.9.3 because a gem required it.
By the same occasion I tried to make good use of RVM.
Installed ruby 1.9.3
rvm install 1.9.3 -C --with-openssl-dir=$HOME/.rvm/usr
Created .rvmrc
cd ./my_project/
rvm --create --rvmrc 1.9.3#project
Cleaned up my global gemset
rvm gemset empty
cd into my project and run installed gems
bundle
Error log
Installing rmagick (2.13.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/joel/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /opt/local/bin/gcc-apple-4.2... yes
checking for Magick-config... yes
Warning: Found more than one ImageMagick installation. This could cause problems at runtime.
/usr/local/ImageMagick/bin/Magick-config reports version 6.7.3 Q16 is installed in
/usr/local/bin/Magick-config reports version 6.7.1 Q16 is installed in /usr/local/Cellar/imagemagick/6.7.1-1
Using 6.7.3 Q16 from .
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... *** 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=/Users/joel/.rvm/rubies/ruby-1.9.3-p429/bin/ruby
/Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/joel/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
from extconf.rb:194:in `<main>'
Gem files will remain installed in /Users/joel/.rvm/gems/ruby-1.9.3-p429#creativebank/gems/rmagick-2.13.2 for inspection.
Results logged to /Users/joel/.rvm/gems/ruby-1.9.3-p429#my_project/gems/rmagick-2.13.2/ext/RMagick/gem_make.out
An error occurred while installing rmagick (2.13.2), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling.
At first sight, it looks like I have 2 installations of ImageMagick and that I could spare one.
So my first question would be how to uninstall clean ImageMagick version 6.7.1 Q16?
and of course if there is something else I could try to solve this issue.
ADDITIONAL INFO about packages installed
I know that MacPort and Brew don't work well together but I always been worried about removing MacPort in its entirety. Could that be the problem?
port list | grep magick
p5-perlmagick #6.8.6-0 perl/p5-perlmagick
p5.8-perlmagick #6.8.6-0 perl/p5-perlmagick
p5.10-perlmagick #6.8.6-0 perl/p5-perlmagick
p5.12-perlmagick #6.8.6-0 perl/p5-perlmagick
p5.14-perlmagick #6.8.6-0 perl/p5-perlmagick
p5.16-perlmagick #6.8.6-0 perl/p5-perlmagick
php-gmagick #1.1.2RC1 php/php-gmagick
php53-gmagick #1.1.2RC1 php/php-gmagick
php54-gmagick #1.1.2RC1 php/php-gmagick
php55-gmagick #1.1.2RC1 php/php-gmagick
php-imagick #3.1.0RC2 php/php-imagick
php53-imagick #3.1.0RC2 php/php-imagick
php54-imagick #3.1.0RC2 php/php-imagick
php55-imagick #3.1.0RC2 php/php-imagick
php-magickwand #1.0.9-2 php/php-magickwand
php53-magickwand #1.0.9-2 php/php-magickwand
php54-magickwand #1.0.9-2 php/php-magickwand
php55-magickwand #1.0.9-2 php/php-magickwand
php5-gmagick #1.1.2RC1 php/php5-gmagick
php5-imagick #3.0.1 php/php5-imagick
php5-magickwand #1.0.9-2 php/php5-magickwand
rb-rmagick #2.13.2 ruby/rb-rmagick
brew list
faac grc jasper lame libtiff libvpx pkg-config wget xvid
ffmpeg imagemagick jpeg libogg libvorbis little-cms theora x264 yasm
UPDATE
Remove MacPorts
sudo port -f uninstall installed
Uninstalled brew ImageMagick and installed it again with brew
Installed XCode latest version
and ran bundle, I do get a different message, C compiler missing ... argh, what should I do next, I am trying installing gcc with brew, but not sure that I am heading the right direction, please help:
Installing rmagick (2.13.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/joel/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /opt/local/bin/gcc-apple-4.2... no
No C compiler found in ${ENV['PATH']}. See mkmf.log for details.
*** 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=/Users/joel/.rvm/rubies/ruby-1.9.3-p429/bin/ruby
Gem files will remain installed in /Users/joel/.rvm/gems/ruby-1.9.3-p429#creativebank/gems/rmagick-2.13.2 for inspection.
Results logged to /Users/joel/.rvm/gems/ruby-1.9.3-p429#creativebank/gems/rmagick-2.13.2/ext/RMagick/gem_make.out
An error occurred while installing rmagick (2.13.2), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling.
GCC 4.2
which gcc => /usr/bin/gcc
gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
echo $PATH
/bin;/usr/bin;/usr/sbin;/sbin;/usr/local/ImageMagick/bin:/usr/local/heroku/bin:/Applications/Postgres.app/Contents/MacOS/bin:/Users/joel/.rvm/gems/ruby-1.9.3-p429#biowatts/bin:/Users/joel/.rvm/gems/ruby-1.9.3-p429#global/bin:/Users/joel/.rvm/rubies/ruby-1.9.3-p429/bin:/Users/joel/.rvm/bin:/usr/bin;usr/local/ImageMagick/bin:/usr/local/heroku/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/ImageMagick/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/joel
NEW ERROR MESSAGE:
Installing json (1.8.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/joel/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
make: /opt/local/bin/gcc-apple-4.2: No such file or directory
make: *** [generator.o] Error 1
Gem files will remain installed in /Users/joel/.rvm/gems/ruby-1.9.3-p429#biowatts/gems/json-1.8.0 for inspection.
Results logged to /Users/joel/.rvm/gems/ruby-1.9.3-p429#biowatts/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
It obviously looking for /opt/local/bin/gcc-apple-4.2 which I deleted recklessly while following these instructions to move from Macportd to homebrew :(
NOW INSTALLING MISSING PACKAGES with homebrew
brew install apple-gcc42
brew install libxml2
Couple things:
Remove MacPorts (you may list all things you installed with them and reinstall those with brew)
Remove imagemagick from homebrew
Install imagemagick again with brew
You're getting this error You have to install development tools first. which (I guess) means you need to install XCode command line tools.
Then bundle install should work!
you need to reinstall your ruby after removing the package manager you used to install it, the easiest way is to:
rvm reinstall 1.9.3-p429
In combination to the 2 first answers
brew uninstall imagemagick
and used http://cactuslab.com/imagemagick/
Then in my .bash_profile I set
PKG_CONFIG_PATH=/opt/ImageMagick/lib/pkgconfig
C_INCLUDE_PATH=/opt/ImageMagick/include/ImageMagick-6
and finally
bundle

Error in rmagick installation in ruby and rails

Hiall,
I am new to ROR . I am trying to install rmagick on my local machine . When I try to install it everytime i get the following error :
Please help me out with this situation .
D:\ruby\bin>gem install rmagick --platform=ruby -- --with-opt-lib=D:\ruby\Rmmagik\lib --with-opt-include=D:\ruby\Rmmagik\include Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
D:/ruby/bin/ruby.exe extconf.rb --with-opt-lib=D:\ruby\Rmmagik\lib --with-opt-include=D:\ruby\Rmmagik\include
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no
Can't install RMagick 2.13.1. Can't find MagickWand.h.
*** 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=${opt-dir}/include
--with-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=D:/ruby/bin/ruby
Gem files will remain installed in D:/ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to D:/ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
Thanks in advance
Surjan
You're missing a header file.
It looks like you're on Windows, right?
If so, a simple solution may be to download the pre-built ImageMagick binary for Windows.
Link
If you're on Debian or Ubuntu:
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
(Editors, feel free to add solutions for other platforms)

Resources