سؤال

I have tried all of the SO and solutions I found on git, but no luck. I am trying to run bundle install on an existing project on a new mbp retina w/ mavericks. Below is my trace:

Installing rmagick (2.13.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/***/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/bin/clang... 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.

brew doctor output

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

    /usr/local/bin/gpg-error-config
    /usr/local/bin/ksba-config
    /usr/local/bin/pkg-config

Warning: Your Homebrew is not installed to /usr/local
You can install Homebrew anywhere you want, but some brews may only build
correctly if you install in /usr/local. Sorry!

Warning: You have a non-Homebrew 'pkg-config' in your PATH:
  /usr/local/bin/pkg-config

`./configure` may have problems finding brew-installed packages using
this other pkg-config.
هل كانت مفيدة؟

المحلول

@isea and I went through this in chat. Key issues were:

  1. Homebrew was installed in a non-standard location. As a general rule, that's dangerous.
  2. Once Homebrew was uninstalled and reinstalled, the pkg-config package needed to be installed using 'brew install pkg-config'

This fixed the issue.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top