2010-10-02 223 views
2

我一直在努力研究安装RMagick的教程,现在我估计已经变得相当远了,但是偶然发现了一个我真的不知道如何解决的错误,也没有得到任何有用的信息。在Rails中安装RMagick-gem的问题

当我尝试安装宝石,我得到这个消息:

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

C:/Ruby192/bin/ruby.exe extconf.rb 
checking for Ruby version >= 1.8.5... 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=C:/Ruby192/bin/ruby 
C:/Ruby192/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 C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp' 
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header' 
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' 
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone' 
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' 
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone' 
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for' 
from C:/Ruby192/lib/ruby/1.9.1/mkmf.rb:833:in `have_header' 
from extconf.rb:193:in `<main>' 


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1 for inspection. 
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick/gem_make.out 

我想,以粗体显示的部分是重要的组成部分,我已经做了一些研究,并已了解, stdint.h是某种标题,但我不知道如何安装它。

我还检查了这让我将这些信息易于读取位mkmf.log文件:

检查Ruby的版本> = 1.8.5 ... ---------- ----------是


"gcc -o conftest -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby192/include/ruby-1.9.1/ruby/backward -IC:/Ruby192/include/ruby-1.9.1 -I.  -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long conftest.c -L. -LC:/Ruby192/lib -L. -lCORE_RL_magick_ -lX11 -lmsvcrt-ruby191-static -lshell32 -lws2_32 " 
cc1.exe: error: unrecognized command line option "-Wno-missing-field-initializers" 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <winsock2.h> 
4: #include <windows.h> 
5: int main() {return 0;} 
/* end */ 

人有什么想法?

非常感谢您的帮助!

Regards,Emil

回答

1

我解决了这个运行“的apt-get安装libmagick9 -dev',它安装了ImageMagicks devkit。

+1

什么是Windows的等效物? – 2011-06-04 00:45:41

+0

对不起,从来没有工作的窗口...试图整整一周没有成功。 – 2011-06-07 06:53:45

0

你在窗户上吗?如果你是,机会是,作为乌拉圭回合的日志说,你需要安装http://rubyforge.org/frs/?group_id=167 < - 因为对于编译不存在某些命令的开发工具包...

+0

谢谢你的回答Kasumi。我在Windows上,并且已经安装了开发工具包。 – 2010-10-03 10:15:52

+0

对不起,我忽略了这一点,你没有安装rmagick的正确版本...... windows有一个单独的gem rmagick-win32,并且注意它需要一个非常特定版本的Image Magick,它附带了源zip文件http:/ /rubyforge.org/frs/?group_id=12 – Kasumi 2010-10-03 13:58:22

+2

我有同样的问题,我可以证实,即使你已经安装了devkit,也会发生这种错误 – 2011-06-04 00:45:04

1

尝试了这一点:

sudo apt-get install libmagickwand-dev

它适用于Ubuntu Linux系统。