从宝石安装RMagick时出错 [英] error installing RMagick from gem
问题描述
相关输出来自gem install rmagick的是:
检查InitializeMagick()in -lMagick ... no
检查InitializeMagick( )in -lMagickCore ... no
在-lMagick ++中检查InitializeMagick()... no
无法安装RMagick 2.6.0。找不到ImageMagick库或其中一个相关库。检查mkmf.log文件以获取更多详细信息。
*** extconf.rb失败***
mkmf.log显示:
have_library:检查InitializeMagick()in -lMagick ... -------- ------------ no
/ usr / local / bin / gcc -o conftest -I。
-I / usr / local / lib / ruby /1.8/i386-solaris2.10 -I。-I / usr / local / include / ImageMagick -I / usr / local / include / ImageMagick conftest.c -L。 - L / usr / local / lib -Wl,-R / usr / local / lib -L / usr / local / lib -R / usr / local / lib -lfreetype -lz -L / usr / local / lib -L / usr / local / lib -lMagickCore -lruby-static -lMagick -ldl -lcrypt -lm -lc
ld:致命:库-lMagick:未找到
ld:致命:文件处理错误。没有输出写入conftest
这是Solaris 10 x86上的ImageMagick版本6.4.3和RMagick版本2.6 .0
如果我需要向LDFLAGS添加某些内容,那么它对我来说不会是什么。我从源代码安装ImageMagick,它应该在通常的地方。即,
#ls -l / usr / local / lib / | grep -i magick
drwxr-xr-x 5 root root 512 Sep 24 23:09 ImageMagick-6.4.3 /
-rw -r - r-- 1 root root 10808764 Sep 25 02:09 libMagickCore.a
-rwxr-xr-x 1 root root 1440 Sep 25 02:09 libMagickCore.la *
-rw -r - r-- 1 root root 2327072 Sep 25 02:09 libMagickWand。 a
-rwxr-xr-x 1 root root 1472 Sep 25 02:09 libMagickWand.la *
ImageMagick-6.4.3 /没有任何有趣的内容,我找不到任何其他文件,我可能能够指向gem install。
任何建议都会非常感谢!
googling没有太大帮助。
谢谢 -
问题解决了。
RMagick无法找到ImageMagick,因为我忽略了构建共享对象(没有安装.so文件,您可以从原始问题中的ls)。解决的办法是在配置选项中添加 - with-shared
。
make
没有针对libiconv的未定义符号消息。通过设置CFLAGS指向libiconv解决了这个问题: export CFLAGS = - liconv
最终,我的成功configure命令是:
./ configure --disable-static --with-modules --without-perl --with-quantum-depth = 8 --with-bzlib = no --with-libiconv
之后,
make
,make install code>和
gem install rmagick
一切正常。
谢谢,
R
Trying to install the RMagick gem is failing with an error about being unable to find ImageMagick libraries, even though I'm sure they are installed.
The pertinent output from gem install rmagick is:
checking for InitializeMagick() in -lMagick... no checking for InitializeMagick() in -lMagickCore... no checking for InitializeMagick() in -lMagick++... no Can't install RMagick 2.6.0. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information. *** extconf.rb failed ***
And looking in mkmf.log reveals:
have_library: checking for InitializeMagick() in -lMagick... -------------------- no "/usr/local/bin/gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/i386-solaris2.10 -I. -I/usr/local/include/ImageMagick -I/usr/local/include/ImageMagick conftest.c -L. - L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/local/lib -L/usr/local/lib -R/usr/local/lib -lfreetype -lz -L/usr/local/lib -L/usr/local/lib -lMagickCore -lruby-static - lMagick -ldl -lcrypt -lm -lc" ld: fatal: library -lMagick: not found ld: fatal: File processing errors. No output written to conftest
This is on Solaris 10 x86 with ImageMagick version 6.4.3 and RMagick version 2.6.0
If I need to add something to LDFLAGS, its not clear to me what that would be. I installed ImageMagick from source and it should be in the usual places. ie,
# ls -l /usr/local/lib/ | grep -i magick drwxr-xr-x 5 root root 512 Sep 24 23:09 ImageMagick-6.4.3/ -rw-r--r-- 1 root root 10808764 Sep 25 02:09 libMagickCore.a -rwxr-xr-x 1 root root 1440 Sep 25 02:09 libMagickCore.la* -rw-r--r-- 1 root root 2327072 Sep 25 02:09 libMagickWand.a -rwxr-xr-x 1 root root 1472 Sep 25 02:09 libMagickWand.la*
ImageMagick-6.4.3/ contains nothing interesting and I can't find any other files that I might be able to point gem install at.
Any advice would be much appreciated!! googling hasn't been too helpful.
thanks -
解决方案problem solved.
RMagick was unable to find ImageMagick because I neglected to build the shared objects (there were no .so files installed as you can see from the "ls" in the original question). The solution was to add
--with-shared
to my configure options.This however caused other problems. Most notably,
make
failing with "undefined symbol" messages for libiconv. This was solved by setting CFLAGS to point to libiconv:export CFLAGS="-liconv"
Ultimately, my successful configure command was:
./configure --disable-static --with-modules --without-perl --with-quantum-depth=8 --with-bzlib=no --with-libiconv
and after that,
make
,make install
, andgem install rmagick
all worked smoothly.thanks,
R
这篇关于从宝石安装RMagick时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!