2011-01-14 86 views
4

我在openSUSE 11.3上安装了RVM。我的首选Ruby版本是MRI 1.9.2p136。 我试图安装RMagick宝石,得到了以下的输出:在openSUSE 11.3上安装RMagick - gem无法构建其扩展

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

/home/user1/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb 
checking for Ruby version >= 1.8.5... yes 
checking for gcc... yes 
checking for Magick-config... yes 

Warning: Found more than one ImageMagick installation. This could cause problems at runtime. 
     /usr/bin/Magick-config reports version 6.6.1 Q16 is installed in /usr 
     /usr/bin/X11/Magick-config reports version 6.6.1 Q16 is installed in /usr 
Using 6.6.1 Q16 from /usr. 

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=/home/user1/.rvm/rubies/ruby-1.9.2-head/bin/ruby 
/home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp' 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header' 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone' 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:276:in `postpone' 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for' 
     from /home/user1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:833:in `have_header' 
     from extconf.rb:193:in `<main>' 

下面是我在mkmf.log:

"gcc -o conftest -I/home/user1/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/i686-linux -I/home/user1/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1/ruby/backward -I/home/user1/.rvm/rubies/ruby-1.9.2-head/include/ruby-1.9.1 -I. -I/usr/include/ImageMagick -I/usr/include/ImageMagick -fopenmp conftest.c -L. -L/home/user1/.rvm/rubies/ruby-1.9.2-head/lib -Wl,-R/home/user1/.rvm/rubies/ruby-1.9.2-head/lib -L/usr/lib -L/usr/lib -L/usr/lib -lMagickCore -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl -Wl,-R -Wl,/home/user1/.rvm/rubies/ruby-1.9.2-head/lib -L/home/user1/.rvm/rubies/ruby-1.9.2-head/lib -lruby-static -lpthread -lrt -ldl -lcrypt -lm -lc" 
/usr/lib/gcc/i586-suse-linux/4.5/../../../../i586-suse-linux/bin/ld: cannot find -lbz2 
collect2: ld returned 1 exit status 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: int main() {return 0;} 
/* end */ 

其实,误差不告诉我任何事情。我已经安装了所有基础开发包和ImageMagick标头。我是否还缺少一些开发二进制文件?

+0

看起来更像是一个系统管理员问题 - 你可能会得到更好的结果在SuperUser.com上询问这个问题 – stef 2011-01-14 08:00:23

回答

6

好的,谢谢你的帖子。我有同样的问题,但答案很简单。 我已经安装了bzip2开发标题。

zypper的在libbz2-devel的

这个任务后rmagick的安装工作。 (也许你有安装完整的bzip2包?)

+1

谢谢,这很有效! – meandre 2011-04-20 09:29:28

+0

哇 - 你是如何从错误信息中解决问题的?您是否垃圾箱 - 潜入mkmf.log日志文件或其他内容?你欠世界一个解释......(加1的方式......)欢呼 – 2013-05-22 12:18:50

3

所以,最后: 到在openSUSE 11.3安装rmagick宝石,先决条件是: 的ImageMagick-devel的,libMagick ++ - devel的,libbz2-devel的

su -c 'zypper in ImageMagick-devel libMagick++-devel libbz2-devel' - 
1

我有同样的问题。我安装了在线程的其余部分提到的所有软件包,但无济于事。最后,我们花了一些没有提到的,但是在错误信息中弹出的 - 我必须安装的软件包是tdl和libtool。

相关问题