2013-10-27 100 views
1

規格: - Windows 7的64位 - 紅寶石2.0.0 64 - 的devkit-mingw64-64-4.7.2Windows安裝rmagick錯誤

我嘗試安裝redmine的包,但是當我使用bundle install然後得到錯誤

d:\www\xampp\htdocs\projekty\redmine\redmine-2.3.3>bundle install 
Fetching gem metadata from https://rubygems.org/......... 
Fetching gem metadata from https://rubygems.org/.. 
Resolving dependencies... 
Using rake (10.1.0) 
Using i18n (0.6.1) 
Using multi_json (1.8.2) 
Using activesupport (3.2.13) 
Using builder (3.0.0) 
Using activemodel (3.2.13) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.2.2) 
Using actionpack (3.2.13) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (3.2.13) 
Using arel (3.0.2) 
Using tzinfo (0.3.38) 
Using activerecord (3.2.13) 
Using activeresource (3.2.13) 
Using bundler (1.3.5) 
Using ffi (1.9.1) 
Using childprocess (0.3.9) 
Using rubyzip (1.0.0) 
Using websocket (1.0.7) 
Using selenium-webdriver (2.37.0) 
Using xpath (1.0.0) 
Using capybara (2.0.3) 
Using coderay (1.0.9) 
Using rack-ssl (1.3.3) 
Using json (1.8.1) 
Using rdoc (3.12.2) 
Using thor (0.18.1) 
Using railties (3.2.13) 
Using jquery-rails (2.0.3) 
Using metaclass (0.0.1) 
Using mocha (0.13.3) 
Using mysql2 (0.3.13) 
Using net-ldap (0.3.1) 
Using ruby-openid (2.2.3) 
Using rack-openid (1.4.0) 
Using rails (3.2.13) 
Installing rmagick (2.13.2) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    C:/Ruby200-x64/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:/Ruby200-x64/bin/ruby 
C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (Ru 
ntimeError) 
You have to install development tools first. 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:561:in `try_cpp' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1040:in `block in have_header' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in postpone' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:306:in `open' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:306:in `open' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:332:in `postpone' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for' 
     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1039:in `have_header' 
     from extconf.rb:194:in `<main>' 


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2 for inspection. 
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/ext/RMagick/gem_make.out 
An error occurred while installing rmagick (2.13.2), and Bundler cannot 
continue. 
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling. 

我有ImageMagick的

d:\www\xampp\htdocs\projekty\redmine\redmine-2.3.3>convert --version 
Version: ImageMagick 6.8.7-2 2013-10-18 Q16 http://www.imagemagick.org 
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC 
Features: DPC OpenMP 
Delegates: bzlib freetype jbig jng jp2 jpeg lcms lqr png ps png tiff webp xml zlib 

我嘗試使用這樣的:

gem install rmagick --platform=ruby -- --with-opt-lib=C:/Ruby200-x64/ImageMagick/lib --with-opt-include=C:/Ruby200-x64/ImageMagick/include 

但我得到了同樣的錯誤。 我mkmf.log是這樣的:

checking for Ruby version >= 1.8.5... -------------------- yes 

-------------------- 

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby200-x64/lib -L. -lCORE_RL_magick_ -lX11 -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi " 
c:/ruby200-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Ruby200-x64/ImageMagick/lib/../lib/X11.lib when searching for -lX11 
c:/ruby200-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Ruby200-x64/ImageMagick/lib/X11.lib when searching for -lX11 
c:/ruby200-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Ruby200-x64/ImageMagick/lib/../lib/X11.lib when searching for -lX11 
c:/ruby200-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Ruby200-x64/ImageMagick/lib/../lib\X11.lib when searching for -lX11 
c:/ruby200-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Ruby200-x64/ImageMagick/lib/X11.lib when searching for -lX11 
c:/ruby200-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/Ruby200-x64/ImageMagick/lib\X11.lib when searching for -lX11 
c:/ruby200-x64/devkit/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lX11 
collect2.exe: error: ld returned 1 exit status 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: #include <winsock2.h> 
4: #include <windows.h> 
5: int main(int argc, char **argv) 
6: { 
7: return 0; 
8: } 
/* end */ 

我沒有任何想法,我做什麼錯。

+0

可能是這個鏈接將幫助你http:// stackoverflow。com/questions/14593055/how-to-install-rmagick-gem-on-windows和http://stackoverflow.com/questions/4873276/i-cant-install-rmagick-gem-on-windows – LHH

+0

我之前嘗試過,但不能正常工作...... – psalkowski

+0

'gem install rmagick -v'2.13.1'--platform = ruby​​ - --with-opt-lib = C:/ImageMagick-6.8.7-Q8/lib --with- opt-include = C:/ ImageMagick-6.8.7-Q8/include'這裏是我用過的表揚。請檢查版本 – Willing

回答

6

因此,我做了同樣的錯誤,我沒有讀完整個redmine安裝指南。在

bundle install --without development test

之後是關於與rmagick寶石故障排除部分。

http://www.redmine.org/projects/redmine/wiki/HowTo_install_rmagick_gem_on_Windows

總之

  • 下載最新的可執行文件,最有可能與dll.exe後綴(我的是ImageMagick的-6.8.7-8-Q16-x86的dll.exe)
  • 勾選複選框以安裝標題
  • 將imagemagick目錄設置在您的PATH變量的第一位。
  • 設置新的環境變量CPATHC:\ImagemagickInstallation\include
  • 設置新的環境變量LIBRARY_PATHC:\ImagemagickInstallation\lib
  • 一定要與紅寶石的devkit和ImageMagick的32個安裝要做到這一點!

然後只需輸入gem install rmagick,本地編譯就可以了。只要確保你獲得了最新的ruby安裝(我的版本是1.9.3)和最新版本的DevKit(我的版本是DevKit-tdm-32-4.5.2)。

請讓我知道如果這對你有用,它終於得到我的redmine安裝去!

+0

,這並不適用於我:(我仍然得到相同的#error指定的量子深度不支持,我已經嘗試了兩個量子版本8和16,都在32位 –

+1

如果它可以幫助其他人我通過安裝ImageMagic 6.6.7來工作 –

0

也許它會幫助你。 我有the same problem,我的環境是:

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 

我成功安裝rmagik寶石,從v6.8.8的ImageMagick的重新安裝到6.6.7之後。 這只是一個不兼容版本的問題...

+0

從http://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/binaries/下載 – Willing