【问题标题】:Package MagickCore was not found in the pkg-config search path在 pkg-config 搜索路径中找不到包 MagickCore
【发布时间】:2016-11-07 02:08:04
【问题描述】:

我试图安装rmagick,但它总是要求PKG_CONFIG_PATH 未配置。

这在我身上发生了多次,所以我将其作为一个问题发布,并为其他面临同样问题的人回答自己。

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

【问题讨论】:

  • brew install imagemagick 在 macOS 上。 stackoverflow.com/questions/10063051/…
  • 您可能需要安装 imagemagick v6,具体取决于您的 rmagick 版本:brew install imagemagick@6 && brew link imagemagick@6 --force

标签: ruby-on-rails imagemagick rmagick


【解决方案1】:

这刚刚为我解决了这个问题(适用于 ubuntu 18.04):

sudo apt-get install libmagick++-dev

【讨论】:

    【解决方案2】:

    CentOS

    yum install ImageMagick-devel
    

    【讨论】:

      【解决方案3】:

      我也有同样的问题。这对我有用(Ubuntu):

      sudo apt-get install libmagickwand-dev
      

      【讨论】:

      • mac机用。
      【解决方案4】:

      rmagick gem 在安装时找不到PKG_CONFIG_PATH。我们需要知道 ImageMagick 的路径在哪里。在 bash 中添加总是更好。

      export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.9.3-7/lib/pkgconfig
      

      【讨论】:

        猜你喜欢
        • 2017-03-01
        • 1970-01-01
        • 2013-02-25
        • 1970-01-01
        • 1970-01-01
        • 2014-10-27
        • 2022-01-25
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多