Can't install rmagick, pkg-config: command not found
Solution 1
Reinstalling pkg-config
solved the issue for me.
Solution 2
I had the same issue with Rmagick after upgrading to Maverick. This solved it:
brew uninstall pkg-config
brew install pkg-config
brew unlink pkg-config && brew link pkg-config
Solution 3
brew install pkg-config
fixed this for me.
Related videos on Youtube
Minh Tri Pham
Updated on June 07, 2022Comments
-
Minh Tri Pham almost 2 years
I'm trying to install rmagick on my Mac OS X v10.9 (Mavericks) machine. However. I get this error
/usr/local/bin/Magick-config: line 41: pkg-config: command not found /usr/local/bin/Magick-config: line 47: pkg-config: command not found /usr/local/bin/Magick-config: line 50: pkg-config: command not found /usr/local/bin/Magick-config: line 53: pkg-config: command not found checking for stdint.h... yes checking for sys/types.h... yes checking for wand/MagickWand.h... yes /usr/local/bin/Magick-config: line 53: pkg-config: command not found Can't install RMagick 2.13.2. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.
The lines 41,17,50,53 in Magick-config are
--cflags) pkg-config --cflags MagickCore ;; --cxxflags) pkg-config --cflags MagickCore ;; --cppflags) pkg-config --cflags MagickCore ;; --ldflags) pkg-config --libs MagickCore ;; --libs) pkg-config --libs MagickCore ;;
I installed ImageMagick with
brew install imagemagick --build-from-source
and before runninggem install rmagick
, I set the path to MagickCore.pc withexport PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.9-1/lib/pkgconfig
and the path to Wand.h withexport C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.9-1/include/ImageMagick-6/
.This worked for the Wand, but not for MagickCore, as I still get
pkg-config: command not found
.I use Ruby 1.9.3p545 and Ruby on Rails 3.2.16.
How can I fix this problem?
-
emcconville almost 10 yearsLooks like you'll need to install
pkg-config
or updatedPATH
to include it's location. Building from source expects this utility to be on the system. -
Minh Tri Pham almost 10 years
pkg-config
already came installed with homebrew. whatPATH
do you want me to update? -
Eric Baldwin almost 10 yearsAre you sure
pkg-config
is in the location you specified? Check withwhich pkg-config
. For me, it's in/usr/local/bin/pkg-config
though I am using OSX 10.7.5
-
-
Lyndsey Ferguson over 9 yearsIn my case,
brew uninstall pkg-config
failed so I just ranbrew install pkg-config
and that fixed my issue. -
Raymond Gan almost 9 yearsYesssss!!!! After several hours of unsuccessfully trying all other StackOverflow solutions, this FINALLY let me install the rmagick gem. Thank you!