加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby – Mac Rmagick不会安装Xcode 4.2

发布时间:2020-12-15 01:52:07 所属栏目:百科 来源:网络整理
导读:我刚刚得到一个新的macbook pro并尝试设置我的开发环境. 我从应用程序商店下载了xcode 4.2并安装了它,之后我安装了自制程序和RVM. ImageMagick,readline,ruby 1.9.3-head全部安装完美,直到我运行捆绑更新,试图安装rmagick. 经过很长一段时间的调查,我得出结
我刚刚得到一个新的macbook pro并尝试设置我的开发环境.
我从应用程序商店下载了xcode 4.2并安装了它,之后我安装了自制程序和RVM.
ImageMagick,readline,ruby 1.9.3-head全部安装完美,直到我运行捆绑更新,试图安装rmagick.

经过很长一段时间的调查,我得出结论,它找不到libgomp.

输出来自gem install rmagick是:

$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.

这是我的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: 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 */

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

>重新安装xcode
>删除imagemagick并重新安装它,包括其他库,如jpg,libpng等
>已安装旧版imagemagick
>删除了.rvm并重新安装了一份新的红宝石副本

我不知道还有什么可以让我尝试,是否有人可以帮我推动我朝这个方向发展?

解决方法

我尝试了你的解决方案(充满了希望)但不幸的是它对我不起作用.
最后,我设法通过在没有openmp支持的情况下重新安装imagemagick来实现它(这是负责lgomp的库)

使用Homebrew:

brew install imagemagick --disable-openmp

然后安装rmagick没有任何问题.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读