RMagick 安装无法构建本机扩展

2024-05-07

在 Mountain Lion 上,我尝试安装 RMagick。我找到了一个GitHub 上的问题 https://github.com/mroth/lolcommits/issues/56解决方案应该是命令gem pristine rmagick。但是当我运行它时,我得到:

ERROR:  While executing gem ... (Gem::Exception)
    Failed to find gems ["rmagick"] >= 0

当我跑步时gem install rmagick,我得到这个巨大的错误:

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

        /Users/xxxxx/.rvm/rubies/ruby-1.9.3-p327/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 clang... yes
checking for Magick-config... yes

Warning: Found more than one ImageMagick installation. This could cause problems at runtime.
         /usr/local/bin/Magick-config reports version 6.7.7 Q16 is installed in /usr/local/Cellar/imagemagick/6.7.7-6
         /opt/ImageMagick/bin/Magick-config reports version 6.7.8 Q16 is installed in /opt/ImageMagick
Using 6.7.7 Q16 from /usr/local/Cellar/imagemagick/6.7.7-6.

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... yes
checking for snprintf() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for AcquireImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for AffinityImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for AffinityImages() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for AutoGammaImageChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for AutoLevelImageChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for BlueShiftImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for ConstituteComponentTerminus() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for DeskewImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for EncipherImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for EqualizeImageChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for FloodfillPaintImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for FunctionImageChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for GetAuthenticIndexQueue() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for GetAuthenticPixels() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for GetImageAlphaChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for GetVirtualPixels() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for LevelImageColors() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for LevelColorsImageChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for LevelizeImageChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for LiquidRescaleImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for MagickLibAddendum() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for OpaquePaintImageChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for QueueAuthenticPixels() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for RemapImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for RemoveImageArtifact() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for SelectiveBlurImageChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for SetImageAlphaChannel() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for SetImageArtifact() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for SetMagickMemoryMethods() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for SparseColorImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for SyncAuthenticPixels() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for TransparentPaintImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for TransparentPaintImageChroma() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for QueryMagickColorname() new signature... yes
checking for Image.type in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for DrawInfo.kerning in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for DrawInfo.interline_spacing in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for DrawInfo.interword_spacing in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for DitherMethod in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for MagickFunction in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for ImageLayerMethod in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for long double in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for AlphaChannelType.CopyAlphaChannel... yes
checking for AlphaChannelType.BackgroundAlphaChannel... yes
checking for CompositeOperator.BlurCompositeOp... yes
checking for CompositeOperator.DistortCompositeOp... yes
checking for CompositeOperator.LinearBurnCompositeOp... yes
checking for CompositeOperator.LinearDodgeCompositeOp... yes
checking for CompositeOperator.MathematicsCompositeOp... yes
checking for CompositeOperator.PegtopLightCompositeOp... yes
checking for CompositeOperator.PinLightCompositeOp... yes
checking for CompositeOperator.VividLightCompositeOp... yes
checking for CompressionType.DXT1Compression... yes
checking for CompressionType.DXT3Compression... yes
checking for CompressionType.DXT5Compression... yes
checking for CompressionType.ZipSCompression... yes
checking for CompressionType.PizCompression... yes
checking for CompressionType.Pxr24Compression... yes
checking for CompressionType.B44Compression... yes
checking for CompressionType.B44ACompression... yes
checking for DistortImageMethod.BarrelDistortion... yes
checking for DistortImageMethod.BarrelInverseDistortion... yes
checking for DistortImageMethod.BilinearForwardDistortion... yes
checking for DistortImageMethod.BilinearReverseDistortion... yes
checking for DistortImageMethod.DePolarDistortion... yes
checking for DistortImageMethod.PolarDistortion... yes
checking for DistortImageMethod.PolynomialDistortion... yes
checking for DistortImageMethod.ShepardsDistortion... yes
checking for DitherMethod.NoDitherMethod... yes
checking for FilterTypes.KaiserFilter... yes
checking for FilterTypes.WelshFilter... yes
checking for FilterTypes.ParzenFilter... yes
checking for FilterTypes.LagrangeFilter... yes
checking for FilterTypes.BohmanFilter... yes
checking for FilterTypes.BartlettFilter... yes
checking for FilterTypes.SentinelFilter... yes
checking for MagickEvaluateOperator.PowEvaluateOperator... yes
checking for MagickEvaluateOperator.LogEvaluateOperator... yes
checking for MagickEvaluateOperator.ThresholdEvaluateOperator... yes
checking for MagickEvaluateOperator.ThresholdBlackEvaluateOperator... yes
checking for MagickEvaluateOperator.ThresholdWhiteEvaluateOperator... yes
checking for MagickEvaluateOperator.GaussianNoiseEvaluateOperator... yes
checking for MagickEvaluateOperator.ImpulseNoiseEvaluateOperator... yes
checking for MagickEvaluateOperator.LaplacianNoiseEvaluateOperator... yes
checking for MagickEvaluateOperator.MultiplicativeNoiseEvaluateOperator... yes
checking for MagickEvaluateOperator.PoissonNoiseEvaluateOperator... yes
checking for MagickEvaluateOperator.UniformNoiseEvaluateOperator... yes
checking for MagickEvaluateOperator.CosineEvaluateOperator... yes
checking for MagickEvaluateOperator.SineEvaluateOperator... yes
checking for MagickEvaluateOperator.AddModulusEvaluateOperator... yes
checking for MagickFunction.ArcsinFunction... yes
checking for MagickFunction.ArctanFunction... yes
checking for MagickFunction.PolynomialFunction... yes
checking for MagickFunction.SinusoidFunction... yes
checking for ImageLayerMethod.FlattenLayer... yes
checking for ImageLayerMethod.MergeLayer... yes
checking for ImageLayerMethod.MosaicLayer... yes
checking for ImageLayerMethod.TrimBoundsLayer... yes
checking for VirtualPixelMethod.HorizontalTileVirtualPixelMethod... yes
checking for VirtualPixelMethod.VerticalTileVirtualPixelMethod... yes
checking for VirtualPixelMethod.HorizontalTileEdgeVirtualPixelMethod... yes
checking for VirtualPixelMethod.VerticalTileEdgeVirtualPixelMethod... yes
checking for VirtualPixelMethod.CheckerTileVirtualPixelMethod... yes
checking for ruby/io.h... yes
checking for rb_frame_this_func() in ruby.h,ruby/io.h... yes
creating extconf.h
creating Makefile


======================================================================
Sat 22Dec12 21:51:19
This installation of RMagick 2.13.1 is configured for
Ruby 1.9.3 (x86_64-darwin12.2.0) and ImageMagick 6.7.7 Q16 
======================================================================



make
compiling rmagick.c
compiling rmdraw.c
compiling rmenum.c
rmenum.c:450:13: warning: 4 enumeration values not handled in switch: 'DivideSrcCompositeOp', 'MinusSrcCompositeOp', 'DarkenIntensityCompositeOp'... [-Wswitch]
    switch (op)
            ^
rmenum.c:565:13: warning: enumeration values 'LZMACompression', 'JBIG1Compression', and 'JBIG2Compression' not handled in switch [-Wswitch]
    switch (ct)
            ^
rmenum.c:674:12: warning: 7 enumeration values not handled in switch: 'SincFastFilter', 'LanczosSharpFilter', 'Lanczos2Filter'... [-Wswitch]
    switch(type)
           ^
rmenum.c:922:12: warning: 5 enumeration values not handled in switch: 'Average9InterpolatePixel', 'Average16InterpolatePixel', 'BlendInterpolatePixel'... [-Wswitch]
    switch(interpolate)
           ^
4 warnings generated.
compiling rmfill.c
compiling rmilist.c
rmilist.c:448:12: warning: 'MapImages' is deprecated [-Wdeprecated-declarations]
    (void) MapImages(new_images, map, dither);
           ^
/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/magick/deprecate.h:197:3: note: 'MapImages' declared here
  MapImages(Image *,const Image *,const MagickBooleanType)
  ^
1 warning generated.
compiling rmimage.c
rmimage.c:8155:12: warning: 'MapImage' is deprecated [-Wdeprecated-declarations]
    (void) MapImage(new_image, map, dither);
           ^
/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/magick/deprecate.h:195:3: note: 'MapImage' declared here
  MapImage(Image *,const Image *,const MagickBooleanType)
  ^
rmimage.c:10701:17: warning: 'RecolorImage' is deprecated [-Wdeprecated-declarations]
    new_image = RecolorImage(image, order, matrix, &exception);
                ^
/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/magick/deprecate.h:139:4: note: 'RecolorImage' declared here
  *RecolorImage(const Image *,const size_t,const double *,ExceptionInfo *)
   ^
2 warnings generated.
compiling rminfo.c
compiling rmmain.c
compiling rmmontage.c
compiling rmpixel.c
compiling rmstruct.c
compiling rmutil.c
rmutil.c:1612:43: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
    rb_raise(Class_FatalImageMagickError, GetLocaleExceptionMessage(severity, reason));
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rmutil.c:1652:20: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
        rb_warning(msg);
                   ^~~
2 warnings generated.
linking shared-object RMagick2.bundle
ld: file not found: /usr/local/lib/libfreetype.6.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [RMagick2.bundle] Error 1


Gem files will remain installed in /Users/xxxxx/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/xxxxx/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

ImageMagick的版本是6.7.7-6。

您能帮我看看如何消除这个错误以及如何最终在 Mountain Lion 上安装 RMagick 吗?


在安装 gem 之前,您是否使用过brew 安装'imagemagick'?

这可以帮助:

brew update
brew remove imagemagick
brew install imagemagick

如果前面的方法仍然不能解决您的问题,则其他:

brew install freetype

Or

brew unlink freetype && brew link freetype

或者安装XQuartz http://xquartz.macosforge.org/landing/.

或者看看rmagick GitHub 页面上的此评论 https://github.com/rmagick/rmagick/issues/60#issuecomment-11541042.

Or

ln -s /opt/X11/lib/libfreetype.6.dylib /usr/local/lib/libfreetype.6.dylib
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

RMagick 安装无法构建本机扩展 的相关文章

  • 如何在heroku上运行一个简单的文件

    假设我已经在 github 上安装了 Rails 应用程序 并且正在 heroku 上部署 github 存储库 我遇到过这样的情况 我有一个包含一堆单词的简单文本文件 它在我的 github 存储库中 我想将这些单词 使用简单的 ruby
  • Rails 中的代码片段应该放在哪里?

    我有这个代码片段 可以为 POST 生成签名 它的细节并不重要 但我想知道的是 由于它不是与模型相关的代码块 所以它确实可以在任何地方使用 在控制器中 在模型中 在视图助手中 即使在视图中 因此 我不确定在哪里 甚至更大的问题是 一旦将其放
  • 在 Ruby 中将多个代码块作为参数传递

    我有一个需要代码块的方法 def opportunity opportunities 1 if yield performances 1 end end 我这样称呼它 opportunity some array empty 但是我如何传递
  • Watir 不会下载 PDF,只能在查看器中打开

    我试图用 Selenium 进行测试 但无法下载 pdf pdf 一直打开 参见我的另一篇文章 RUBY Selenium Webdriver 设置为下载 pdf 文件而不是打开它们 https stackoverflow com ques
  • 机架测试失败:JSON 请求尚未响应

    我正在尝试为我的 Ruby 项目创建一个 JSON API 如下所示Ticketee https github com rails3book ticketeeYehuda Katz 书中提供的示例Rails 3 实际应用 http www
  • 供用户使用的 Rails 模型结构

    我是 Rails 新手 正在开发我的第二个 Rails 应用程序 该应用程序将为用户提供不同的角色 但某些用户将具有多个角色 该网站的每个用户都将是艺术家 一些用户将担任主持人的角色 我将如何构建这个 在我使用的一些 PHP 应用程序中 只
  • 在 Ruby 中将 Time 类对象转换为 RFC3339

    谷歌日历 API v2 https developers google com google apps calendar v2 developers guide protocol的时间相关查询需要采用 RFC3339 格式 当我在 需要 时
  • 如何使用 ruby​​zip 库获取压缩文件的内容?

    我正在尝试提取上传的 zip 文件并将其内容存储在数据库中 每个文件一个条目 rubyzip 库几乎没有有用的文档 有一个资产表 其中包含键 string 文件名 和数据 binary 文件内容 我正在使用 ruby zip 库 并且已经做
  • 使用 ruby​​ Net::SSH 通过 sudo 读取远程文件

    我必须读取我有权 sudo 读取的远程文件的内容 猫 少或尾巴 我将在 Ruby 中执行此操作 因此我认为应该使用 Net SSH 来执行此操作 该文件是一个日志文件 因此可能会很大 这是我现在正在尝试的代码 require rubygem
  • Ruby 多维数组

    也许只是我缺乏在这里找到东西的能力 这就是问题所在 但我找不到任何关于如何在 Ruby 中创建多维数组的信息 有人可以给我一个如何做的例子吗 严格来说 在 Ruby 中创建多维数组是不可能的 但是可以将一个数组放入另一个数组中 这与多维数组
  • 与 Array 相比,使用 Ruby NArray 有哪些优点?

    我刚刚遇到了 Ruby 的 NArray 库 请原谅我在问这个问题时的无知 与标准 Ruby Array 实现相比 使用 NArray 库有哪些优点 我已经看到 NArray 是面向数值计算的 但是看看 API 看起来好像只有一些针对数值的
  • 字符串被两个不同的分隔符分割

    我有这样的字符串 some dasd dasd dasdas dasdas dasd das dsad 我需要用两个不同的符号将字符串拆分为数组 and 所以我想得到数组 some dasd dasd dasdas dasdas dasd
  • Ruby 中实现的所有设计模式的备忘单?

    我想知道是否有针对 Ruby 中实现的所有设计模式的备忘单 这样您就不必重新发明轮子 设计模式对于组织大量代码非常有用 因为您不需要像在 verbose algol derivitive language 中那样编写那么多代码来在 ruby
  • 使用自定义 gem 在 Dreamhost/Passenger 上部署 Sinatra 应用程序

    我有一个 Sinatra 应用程序 正在尝试在 Dreamhost 上运行 该应用程序利用 pony 发送电子邮件 为了让应用程序从一开始就启动并运行 在添加小马之前 我必须gem unpack rack and gem unpack si
  • 带有可选第一个哈希参数和keyword_args的奇怪方法行为

    我有以下方法 def test first param nil keyword arg nil puts first param first param puts keyword arg keyword arg end 以下所有调用都按照我
  • 使用 Ruby 替换文件中的特定行

    我有一个如下所示的文本文件 a txt open close open open close open 我需要找到一种方法将第三行替换为 close 我做了一些搜索 大多数方法都涉及搜索该行而不是替换它 在这里不能真正做到这一点 因为我不想
  • 在所有延迟的作业之前挂钩

    是否可以在所有delayed job任务之前运行一个方法 基本上 我们试图确保每台运行delayed job的服务器都有我们代码的最新实例 因此我们希望运行一个方法来在每个作业运行之前检查这一点 我们已经有了 check 方法并在其他地方使
  • Ruby On Rails 与 Windows Vista - 最佳设置? [关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 您认为 Win Vista 环境中 RoR 的最佳设置是什么 我尝试过 radrails eclipse 插件 它对我来说似乎太庞大了 我也开始
  • Sublime Text 是否支持 Ruby API(自动完成)?

    如何获取可用于某些对象或类的方法列表 如下所示 Sublime Text 有针对 Ruby 的此功能吗 像这样https github com BoundInCode Display Functions https github com B
  • Ruby `split':UTF-8 中的无效字节序列(ArgumentError)

    我正在尝试填充电影对象 但是在解析时u item文件我收到此错误 split UTF 8 中的无效字节序列 ArgumentError File open Data u item r do infile while line infile

随机推荐