1

规格: - Windows 7 x64 - Ruby 2.0.0 x64 - DevKit-mingw64-64-4.7.2

我尝试安装 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 */

我不知道我做错了什么。

4

2 回答 2

6

因此,我犯了和你一样的错误,我没有阅读整个 redmine 安装指南。之后

bundle install --without development test

是关于使用rmagickgem 进行故障排除的部分。

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变量的第一个位置。
  • CPATH设置新的环境变量C:\ImagemagickInstallation\include
  • 设置新的环境变量LIBRARY_PATH C:\ImagemagickInstallation\lib
  • 请务必使用 ruby​​、devkit 和 imagemagick 的 32 位安装!

然后只需键入gem install rmagick,本机编译就可以了。只要确保您安装了最新的 ruby​​(我的是 1.9.3)和适用于您的版本的最新 DevKit(我的是 DevKit-tdm-32-4.5.2)。

请让我知道这是否适合您,它终于让我的 redmine 安装开始了!

于 2013-12-05T10:14:56.323 回答
0

也许它会帮助你。我有同样的问题,我的环境是:

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

在将 ImageMagick 从 v6.8.8 重新安装到 6.6.7 后,我成功安装了 rmagik gem。只是版本不兼容的问题...

于 2014-01-14T15:34:07.063 回答