2013-03-01 23 views
3

我正在尝试在我的画廊上工作,而且我需要安装rmagick。但是,我一直无法这样做,因为我无法构建gem本机扩展时遇到错误。我看到其他帖子,但他们的错误与地雷不同。Rmagick未能在OSX Lion上创建原生Gem

我不知道如何让它工作。如果有人知道一个修复会有很大的帮助!

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /Users/lexi87/.rvm/rubies/ruby-1.9.3-p385/bin/ruby extconf.rb 
checking for Ruby version >= 1.8.5... yes 
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 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 TransformImageColorspace() 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 


====================================================================== 
Thu 28Feb13 20:39:13 
This installation of RMagick 2.13.2 is configured for 
Ruby 1.9.3 (x86_64-darwin12.2.0) and ImageMagick 6.8.0 Q16 
====================================================================== 



make 
compiling rmagick.c 
compiling rmdraw.c 
compiling rmenum.c 
compiling rmfill.c 
compiling rmilist.c 
rmilist.c: In function ‘ImageList_map’: 
rmilist.c:448: warning: ‘MapImages’ is deprecated (declared at /usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/magick/deprecate.h:200) 
compiling rmimage.c 
rmimage.c: In function ‘Image_map’: 
rmimage.c:8159: warning: ‘MapImage’ is deprecated (declared at /usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/magick/deprecate.h:198) 
rmimage.c: In function ‘Image_recolor’: 
rmimage.c:10705: warning: ‘RecolorImage’ is deprecated (declared at /usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/magick/deprecate.h:140) 
compiling rminfo.c 
compiling rmmain.c 
compiling rmmontage.c 
compiling rmpixel.c 
compiling rmstruct.c 
compiling rmutil.c 
rmutil.c: In function ‘rm_fatal_error_handler’: 
rmutil.c:1612: warning: format not a string literal and no format arguments 
rmutil.c: In function ‘handle_exception’: 
rmutil.c:1652: warning: format not a string literal and no format arguments 
linking shared-object RMagick2.bundle 
ld: file not found: /usr/local/lib/libltdl.7.dylib for architecture x86_64 
collect2: ld returned 1 exit status 
make: *** [RMagick2.bundle] Error 1 


Gem files will remain installed in /Users/lexi87/.rvm/gems/ruby-1.9.3-p385/gems/rmagick-2.13.2 for inspection. 
Results logged to /Users/lexi87/.rvm/gems/ruby-1.9.3-p385/gems/rmagick-2.13.2/ext/RMagick/gem_make.out 
An error occurred while installing rmagick (2.13.2), and Bundler cannot continue. 
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling. 

回答

2

要解决这个问题,我必须卸载然后重新安装RVM。然后运行'brew install ruby​​'以获取最新版本。然后'捆绑'。

我希望这可以帮助其他人遇到我所做的确切的错误。

5

看起来你错过了一个名为libltdl的共享库,它是构建gem所必需的。快速Google搜索显示,这是由libtool package提供的。

  1. 尝试安装libtool,看看是否解决了问题。如果您有Homebrew,则可以使用brew install libtool完成此操作。

  2. 显然,对山狮一known issue,其中提出的解决方案是:更新的XCode 4.4,更新Xcode的命令行工具,安装XQuartz(可能不需要这个),最后:

    brew uninstall imagemagick 
    brew install --fresh imagemagick 
    
+0

它说已安装libtool-2.4.2 – pwz2000 2013-03-01 02:26:19

+0

山狮有一个[已知问题](https://github.com/mroth/lolcommits/issues/65#issuecomment-7280659),但我不是当然,如果这个解决方案能够帮助你,那么你说你是在狮子座上。 – adamdunson 2013-03-01 02:35:20

+0

另外,你的make日志显示它正在'/ usr/local/lib'目录中寻找'libltdl',但我猜这里面没有任何东西? – adamdunson 2013-03-01 02:40:57

3

缺少的库是由libtool包提供的。您可以通过BREW安装:

酿造INSTAL libtool的

安装后你得到这个消息:

的Xcode 4.2和下面提供glibtool。

通常这对你没有任何后果。如果你建立你自己的 软件,它需要这个公式,你需要添加到您的 生成变量:

LDFLAGS: -L/usr/local/opt/libtool/lib 
CPPFLAGS: -I/usr/local/opt/libtool/include 

添加这些环境变量当前环境:

export LDFLAGS="-L/usr/local/opt/libtool/lib" 
export CPPFLAGS="-I/usr/local/opt/libtool/include" 

然后再安装rmagick gem。我也将XCode命令行工具更新到最新版本。

相关问题