在 openSUSE 11.3 上安装 RMagick - gem 无法构建其扩展

发布于 10-11 23:44 字数 3807 浏览 7 评论 0原文

我在 openSUSE 11.3 上安装了 RVM。我首选的 Ruby 版本是 MRI 1.9.2p136。 我尝试安装 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 标头。我还缺少一些开发二进制文件吗?

I have RVM installed on openSUSE 11.3. My preferred Ruby version is MRI 1.9.2p136.
I tried to install RMagick gem and got the following output:

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>'

Here's what I have in 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 */

Actually, the error doesn't tell me anything. I have already installed all basic development packages and ImageMagick headers. Am I still missing some development binaries?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

寄与心2024-10-18 23:44:33

所以,最后:
要在 openSUSE 11.3 上安装 rmagick gem,先决条件是:
ImageMagick-开发、libMagick++-开发、libbz2-开发

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

So, finally:
to install rmagick gem on openSUSE 11.3, prerequisites are:
ImageMagick-devel, libMagick++-devel, libbz2-devel

su -c 'zypper in ImageMagick-devel libMagick++-devel libbz2-devel' -
欢烬2024-10-18 23:44:33

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

I had the same problem. I installed all the packages mentioned in the rest of the thread, to no avail. In the end it took a couple which weren't mentioned, but which had popped up in error messages - the packages I had to install were tdl and libtool.

谁的新欢旧爱2024-10-18 23:44:32

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

libbz2-devel 中的 zypper

完成此任务后,rmagick 的安装就开始工作了。 (也许你必须安装完整的 bzip2 包?)

Ok, thanks for your post. I had the same problem, but the answer was quite easy.
I've installed the bzip2 development headers.

zypper in libbz2-devel

After this tasks the installation of rmagick worked. (Maybe you have to install the complete bzip2 package?)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文