Mac Rmagick不会安装Xcode 4.2 [英] Mac Rmagick won't install with Xcode 4.2

查看:137
本文介绍了Mac Rmagick不会安装Xcode 4.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚获得了一个新的Macbook Pro,并试图设置我的开发环境。
我从应用商店下载了xcode 4.2并安装了它,之后我安装了自制软件和RVM。
ImageMagick,readline,ruby 1.9.3-head都安装完美,直到我运行试图安装rmagick的软件包更新。



经过很长时间的调查下面是它找不到libgomp的结论。



输出来自 gem install rmagick is:

  $ gem install rmagick 
构建原生扩展。这可能需要一段时间...
错误:安装rmagick时出错:
错误:无法构建gem本机扩展。

/Users/dhiemstra/.rvm/rubies/ruby-1.9.3-head/bin/ruby extconf.rb
检查Ruby版本> = 1.8.5 ...是
extconf.rb:128:使用RbConfig而不是过时的和不赞成使用的配置。
检查叮...是
检查Magick-config ...是
检查ImageMagick版本> = 6.4.9 ...是
检查HDRI禁用ImageMagick的版本...是
检查stdint.h ... *** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
图书馆和/或标题。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--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 / dhiemstra / .rvm / rubies / ruby​​-1.9.3-head / bin / ruby​​
/Users/dhiemstra/.rvm/rubies/ ruby-1.9.3-head / lib / ruby​​ / 1.9.1 / mkmf.rb:381:在`try_do'中:编译器无法生成可执行文件。 (RuntimeError)
您必须先安装开发工具。

这是我的mkmf.log文件:

 clang -o conftest -I / Users / dhiemstra / .rvm / rubies / ruby​​-1.9.3-head / include / ruby​​-1.9.1 / x86_64 -darwin11.2.0  - I / Users / dhiemstra / .rvm / rubies / ruby​​-1.9.3-head / include / ruby​​-1.9.1 / ruby​​ / backward -I / Users / dhiemstra / .rvm / rubies / ruby​​-1.9.3-head / include / ruby​​-1.9.1 -I。-I / usr / local / Cellar / imagemagick / 6.7.1-1 / include / ImageMagick -I / usr / local / Cellar / imagemagick / 6.7.1-1 / include / ImageMagick -fopenmp conftest.c -L。-L / Users / dhiemstra / .rvm / rubies / ruby​​-1.9.3-head / lib -L ​​/ usr / local / Cellar / imagemagick / 6.7.1-1 / lib -L ​​/ usr / x11 / lib -L ​​/ usr / local / Cellar / imagemagick / 6.7.1-1 / lib -lMagickCore -llcms -ltiff -lfreetype -ljpeg -L / usr / X11 / lib -lfontconfig -lXext -lSM -lice  - lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl -lruby.1.9.1 -lpthread -ldl -lobjc
ld:找不到-lgomp
的文件夹clang:error:linker命令退出代码1失败(使用-v查看调用)
检查的程序是:
/ * begin * /
1: #includeruby.h
2:
3:int main(){return 0;}
/ * end * /
pre>

现在我在这里假设xcode出了问题,我试了几件事:


  • 重新安装xcode

  • 删除imagemagick并重新安装它,包括其他库,如jpg,libpng等

  • 安装旧版本的imagemagick

  • 删除了.rvm并重新安装了一个新的ruby副本



我不知道剩下什么可以尝试,任何人都可以帮助推动我的方向吗?

解决方案

我试图下载并安装4.1狮子,甚至安装(没有适当的错误信息)。
现在一位同事给了我这个GCC for Mac的好链接,它的功能就像一个魅力:
https://github.com/kennethreitz/osx-gcc-installer



不要忘记下载v2,如果你运行在> 10.7.0


I just got a new macbook pro and trying to setup my dev environment. I downloaded xcode 4.2 from the app store and installed it, after this i installed homebrew and RVM. ImageMagick, readline, ruby 1.9.3-head all installed perfectly until i ran bundle update which tried to install rmagick.

After a long long time investigating i come down to the conclusion that it can't find libgomp.

The output is from gem install rmagick is:

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

        /Users/dhiemstra/.rvm/rubies/ruby-1.9.3-head/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
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.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/dhiemstra/.rvm/rubies/ruby-1.9.3-head/bin/ruby
/Users/dhiemstra/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

Here is my mkmf.log file:

"clang -o conftest -I/Users/dhiemstra/.rvm/rubies/ruby-1.9.3-head/include/ruby-1.9.1/x86_64-darwin11.2.0 -I/Users/dhiemstra/.rvm/rubies/ruby-1.9.3-head/include/ruby-1.9.1/ruby/backward -I/Users/dhiemstra/.rvm/rubies/ruby-1.9.3-head/include/ruby-1.9.1 -I.  -I/usr/local/Cellar/imagemagick/6.7.1-1/include/ImageMagick  -I/usr/local/Cellar/imagemagick/6.7.1-1/include/ImageMagick -fopenmp conftest.c  -L. -L/Users/dhiemstra/.rvm/rubies/ruby-1.9.3-head/lib  -L/usr/local/Cellar/imagemagick/6.7.1-1/lib -L/usr/X11/lib    -L/usr/local/Cellar/imagemagick/6.7.1-1/lib -lMagickCore -llcms -ltiff -lfreetype -ljpeg -L/usr/X11/lib -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl  -lruby.1.9.1  -lpthread -ldl -lobjc "
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main() {return 0;}
/* end */

Now i assumed here that something was wrong with xcode i tried several things:

  • Reinstall xcode
  • Remove imagemagick and reinstalled it including other libraries like jpg, libpng etc
  • Installed older version of imagemagick
  • Removed .rvm and reinstalled a fresh copy of ruby

I have no clue what's left for me to try, could anyone help to push me in the good direction?

解决方案

I tried to download and install 4.1 for lion and this didn't even install (without a proper error message). Now a colleague gave me this great link to GCC for Mac which worked like a charm: https://github.com/kennethreitz/osx-gcc-installer

Don't forget to download the v2 if you run on > 10.7.0

这篇关于Mac Rmagick不会安装Xcode 4.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆