如何使用ruby 1.9.3在Windows XP中安装rmagick

时间:2014-01-14 11:11:38

标签: windows webkit imagemagick rmagick ruby-1.9.3

一般来说,在Windows上安装Ruby环境是BAD和STUPID的想法! 在你做之前要好好考虑1000次!!!

我的环境:

  • Windows XP(x32)
  • ruby​​ 1.9.3p484(2013-11-22)[i386-mingw32]
  • 的devkit-TDM-32-4.5.2-20111229-1559-SFX
  • 的ImageMagick-6.8.8-2-Q8-x64的static.exe

我正在使用本手册:https://github.com/oneclick/rubyinstaller/wiki/Development-Kit

我做了3次以上的尝试安装它! 在您的机器上购买新笔记本电脑或安装Linux更容易,更好!

经过4个小时的痛苦和痛苦,我很幸运能够成功运行'捆绑安装'。 顺便说一句,我建议:

  1. 将ruby安装到C:/ ruby​​193(而不是'Program Files'!!!)
  2. 将devkit安装到C:/ DevKit(不是'Program Files'!!!)
  3. 我不明白WTF正在继续这样做。现在我有了新的错误:) 这是ImageMagik的一个神奇问题(我认为撒旦自己编写了这个程序!) 现在我无法安装rmagick,导致ruby,devkit,ImageMagik或rmagik的一些问题。

    运行时我看到了这个错误:

    gem install rmagick -v '2.13.2' -- '--with-opt-dir="C:\ImageMagick"'

    
    
    ======================================================================
    Tue 14Jan14 12:31:38
    This installation of RMagick 2.13.2 is configured for
    Ruby 1.9.3 (i386-mingw32) and ImageMagick 6.8.8
    ======================================================================
    
    make
    generating RMagick2-i386-mingw32.def
    compiling rmagick.c
    In file included from rmagick.c:13:0:
    rmagick.h:81:2: error: #error Specified QuantumDepth is not supported.
    rmagick.c: In function 'Magick_colors':
    rmagick.c:42:5: warning: passing argument 2 of 'GetColorInfoList' from incompatible pointer ty
    C:\ImageMagick\include/magick/color.h:75:5: note: expected 'size_t *' but argument is of type
    rmagick.c: In function 'Magick_fonts':
    rmagick.c:90:5: warning: passing argument 2 of 'GetTypeInfoList' from incompatible pointer typ
    C:\ImageMagick\include/magick/type.h:98:5: note: expected 'size_t *' but argument is of type '
    rmagick.c: In function 'Magick_init_formats':
    rmagick.c:178:5: warning: passing argument 2 of 'GetMagickInfoList' from incompatible pointer
    C:\ImageMagick\include/magick/magick.h:129:5: note: expected 'size_t *' but argument is of typ
    make: *** [rmagick.o] Error 1
    
    
    Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2 for insp
    Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out
    
    
    

    几个小时后我明白了,我遇到了这个问题, 安装ImageMagik的原因我忘了设置一个复选框:

    enter image description here

    现在我在终端中看到了新的错误类型:

    
    C:\Documents and Settings\Bogdan>gem install rmagick -v '2.13.2' -- '--with-opt-dir="C:\ImageMagick"'
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    ERROR:  Error installing rmagick:
            ERROR: Failed to build gem native extension.
    
            C:/Ruby193/bin/ruby.exe extconf.rb --with-opt-dir="C:\ImageMagick"
    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
            --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:/Ruby193/bin/ruby
    C:/Ruby193/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.
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open'
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open'
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
            from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
            from extconf.rb:194:in `'
    
    

    它是什么,我该如何解决? 拜托,帮帮我

    enter image description here

1 个答案:

答案 0 :(得分:2)

哇!!!这是某种喜剧,  但我卸载了ImageMagick-6.8.8并安装了ImageMagick-6.6.7。


C:\Documents and Settings\Bogdan>gem install rmagick -v '2.13.2' -- '--with-opt-dir="C:\ImageMagick"'
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.2
1 gem installed
Installing ri documentation for rmagick-2.13.2...
Installing RDoc documentation for rmagick-2.13.2...

成功安装了RMAGICK-2.13.2 !!!!!!