Cannot install gem RMagick after upgrade to Mac OS X Maverick - ruby-on-rails

I have some issue about rails, after i upgrade to new version of mac os x Maverick. my rmagick wont install.
I've already follow to install imagemagick 6.8.0-10
and add
$ cd "Magick-config --prefixlib"
$ ln -s libMagick++-Q16.7.dylib libMagick++.dylib
$ ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib
$ ln -s libMagickWand-Q16.7.dylib libMagickWand.dylib
and install gem install rmagick.
and got this message.
Fetching: rmagick-2.13.2.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for xcrun... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... 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
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
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
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
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no
Can't install RMagick 2.13.2. 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
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/rmagick-2.13.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/rmagick-2.13.2/ext/RMagick/gem_make.ou
t

Related

RMagick Redhat 7.2 error: Package MagickCore was not found in the pkg-config search path

I am deploying my Rails 4.2 application in Redhat Linux 7.2 version. I cloned
my project and when I run bundle install, I am facing Rmagick error. When I try to install it manually, I am facing errors as:
[root#ip-172-xx-xx-xxx Project2]# gem install rmagick -v '2.13.4'
Building native extensions. This could take a while... ERROR: Error
installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/rmagick-2.13.4/ext/RMagick
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r
./siteconf20161020-28371-150wzyp.rb extconf.rb checking for Ruby
version >= 1.8.5... yes checking for gcc... yes checking for
Magick-config... no checking for pkg-config... yes checking for
ImageMagick version >= 6.4.9... 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 Package MagickCore was not found in the
pkg-config search path. Perhaps you should add the directory
containingMagickCore.pc' to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found 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 Package MagickCore was not found in the
pkg-config search path. Perhaps you should add the directory
containingMagickCore.pc' to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found checking for stdint.h... yes checking
for sys/types.h... yes checking for wand/MagickWand.h... no
Can't install RMagick 2.13.4. 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
--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/rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.13.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/usr/local/rvm/gems/ruby-2.3.0/gems/rmagick-2.13.4 for inspection.
Results logged to
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.13.4/gem_make.out
I tried running:
`yum install ImageMagick` (Installed ImageMagick-6.7.8.9-15.21.amzn1.x86_64)
`yum install ImageMagick-devel` (It said 'No package found')
I tried thislink where we have
to find MagickCore.pc, but I didn't found any MagickCore in my system.
Please help how to handle this issue.
ImageaMagick, as different other larger projects, installs the pkg-config pc.-files of project-internal libraries in the subdirectory specific to the project.
In case of ImageMagick, this is usually the path /usr/lib/imagemagick6/pkgconfig/ instead of /usr/lib/pkgconfig/.
An easy fix is provided by adding the directory to the PKG_CONFIG_PATH environment variable via
$ export PKG_CONFIG_PATH=PKG_CONFIG_PATH:/usr/lib/imagemagick6/pkgconfig
A different approach is using the CLI-option --with-path for pkg-config. So in your case:
$ pkg-config --with-path=/usr/lib/imagemagick6/pkgconfig/
However, this means touching the pkg-config command of your package installation, which may be not possible in the mentioned case.

ERROR: Error installing rmagick on Redhat 7

I am trying to run my Rails application in Redhat7 but facing this error when I run bundle install:
An error occurred while installing rmagick (2.13.4), and Bundler
cannot continue. Make sure that gem install rmagick -v '2.13.4'
succeeds before bundling.
When I run gem install rmagick, this is the error I am getting:
[root#ip-172-12-13-148 MyProject]# gem install rmagick -v '2.13.4'
Building native extensions. This could take a while... ERROR: Error
installing rmagick: ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/rmagick-2.13.4/ext/RMagick
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r
./siteconf20160818-2119-1nvxrgu.rb extconf.rb checking for Ruby
version >= 1.8.5... yes checking for gcc... yes checking for
Magick-config... no checking for pkg-config... yes checking for
ImageMagick version >= 6.4.9... 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 Package MagickCore was not found in the
pkg-config search path. Perhaps you should add the directory
containingMagickCore.pc' to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found 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 Package MagickCore was not found in the
pkg-config search path. Perhaps you should add the directory
containingMagickCore.pc' to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found checking for stdint.h... yes checking
for sys/types.h... yes checking for wand/MagickWand.h... no
Can't install RMagick 2.13.4. 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 --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/rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.13.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/usr/local/rvm/gems/ruby-2.3.0/gems/rmagick-2.13.4 for inspection.
Results logged to
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.13.4/gem_make.out
I tried using
yum install IMageMagickand run bundle, but issue continues.
[root#ip-172-12-13-148 MyProject]# yum install ImageMagick-devel
then:
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
No package ImageMagick-devel available.
Error: Nothing to do Please help.
Please help.
For RedHat try running this command
yum install ImageMagick ImageMagick-devel
Refer - this

Package MagickCore was not found in the pkg-config search path

I was trying to install rmagick and it always asks for PKG_CONFIG_PATH not configured.
This happened multiple times to me, so I'm posting this as an issue and answering myself for anyone else facing same issue.
User-MacBook-Pro:rsscom macuser$ gem install rmagick -v '2.13.3'
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/macuser/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20160705-63310-klqxmw.rb extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... 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
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
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
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
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no
Can't install RMagick 0.0.0. 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
--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/macuser/.rvm/rubies/ruby-2.2.0/bin/$(RUBY_BASE_NAME)
extconf failed, exit code 1
Gem files will remain installed in /Users/macuser/.rvm/gems/ruby-2.2.0/gems/rmagick-2.13.3 for inspection.
Results logged to /Users/macuser/.rvm/gems/ruby-2.2.0/extensions/x86_64-darwin-14/2.2.0-static/rmagick-2.13.3/gem_make.out
I have the the same problem. This work for me (Ubuntu):
sudo apt-get install libmagickwand-dev
rmagick gem is not able find PKG_CONFIG_PATH while installing. We need to tell where the path for the ImageMagick exists. It's always better to add in the bash.
export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.9.3-7/lib/pkgconfig
This just solved the issue for me (works on ubuntu 18.04):
sudo apt-get install libmagick++-dev
CentOS
yum install ImageMagick-devel

rmagick and imagemagick bundle/homebrew error

Please see error stack below. I tried uninstall/install of imagemagick via homebrew, 'gem pristine rmagick', and reinstall of rmagick. All have returned the same error. Any help would be VERY much appreciated- been at this for a while now.
$ gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/LU/.rvm/rubies/ruby-1.9.3-p362/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 /usr/local/bin/gcc-4.2... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... yes
checking for InitializeMagick() in -lMagickCore... no
checking for InitializeMagick() in -lMagick... no
checking for InitializeMagick() in -lMagick++... no
Can't install RMagick 2.13.1. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.
*** 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/Lungs/.rvm/rubies/ruby-1.9.3-p362/bin/ruby
--with-MagickCorelib
--without-MagickCorelib
--with-Magicklib
--without-Magicklib
--with-Magick++lib
--without-Magick++lib
Gem files will remain installed in /Users/Lungs/.rvm/gems/ruby-1.9.3-p362/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/LU/.rvm/gems/ruby-1.9.3-p362/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
Had the same problem, easy fix!
https://github.com/mxcl/homebrew/issues/16625
here is the skinny on the solution (rmagick is broken, and you have to create symlinks to get it to work):
cd /usr/local/Cellar/imagemagick/6.8.0-10/lib
ln -s libMagick++-Q8.7.dylib libMagick++.dylib
ln -s libMagickCore-Q8.7.dylib libMagickCore.dylib
ln -s libMagickWand-Q8.7.dylib libMagickWand.dylib
Alternatively, step back one ImageMagick rev:
(via https://stackoverflow.com/a/9832084/485836)
> cd /usr/local
> brew versions imagemagick
6.7.7-6 git checkout 883f549 Library/Formula/imagemagick.rb
6.7.5-7 git checkout f965101 Library/Formula/imagemagick.rb
6.7.1-1 git checkout be8e0ff Library/Formula/imagemagick.rb
...
> git checkout 883f549 Library/Formula/imagemagick.rb
> brew install imagemagick
A better way to get the headers into the proper place might be to just add the pkgconfig from the imagemagick Cellar to your PKG_CONFIG_PATH.
Adding the following to my ~/.bash_profile and then sourcing it (source ~/.bash_profile) worked for me
export PKG_CONFIG_PATH="/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig:$PKG_CONFIG_PATH"
Ended up being an issue with rails version, needed to update and reinstall imagemagick/rmagick.
brew install imagemagick
should do the trick. Then reinstall the gems.

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