我无法在Windows上安装rmagick gem [英] I can't install rmagick gem on windows

查看:152
本文介绍了我无法在Windows上安装rmagick gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了ruby 1.9.2和rails 3.0.3。我试图安装rmagick gem但是当我运行 bundle install 我收到一个错误告诉我:

I used ruby 1.9.2 and rails 3.0.3. iam trying to install rmagick gem but when i run bundle install I got an error tells me:

Installing rmagick (2.12.1) with native extensions c:/Ruby192/lib/ruby/site_ruby
/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR
: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

       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 genera
te 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 postp
one'
       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:171:in `<main>'


Gem files will remain installed in c:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2
.12.1 for inspection.
Results logged to c:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.12.1/ext/RMagick
/gem_make.out
       from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:507:in `b
lock in build_extensions'
       from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `e
ach'
       from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `b
uild_extensions'
       from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `i
nstall'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/sour
ce.rb:96:in `install'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst
aller.rb:55:in `block in run'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec
_set.rb:12:in `block in each'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec
_set.rb:12:in `each'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec
_set.rb:12:in `each'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst
aller.rb:44:in `run'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst
aller.rb:8:in `install'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/cli.
rb:226:in `install'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend
or/thor/task.rb:22:in `run'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend
or/thor/invocation.rb:118:in `invoke_task'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend
or/thor.rb:246:in `dispatch'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend
or/thor/base.rb:389:in `start'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/bin/bundle:13:in
`<top (required)>'
       from c:/Ruby192/bin/bundle:19:in `load'
       from c:/Ruby192/bin/bundle:19:in `<main>'

我从 http://rubyinstaller.org/downloads/ ,包含开发套件和最新版本的ImageMagick。我尝试设置rmagick配置(lib和include目录),但我仍然得到相同的错误

I installed ruby from http://rubyinstaller.org/downloads/ with development kit and the latest version of ImageMagick. I tried to set rmagick configurations (lib and include directories) but I still get the same error

任何帮助?有什么想法解决这个问题?

any help? any thoughts to solve the issue?

推荐答案

先决条件:

Ruby> 1.8.6

DevKit(任何版本)

没有其他ImageMagick安装或PATH条目

Prerequisites:
Ruby > 1.8.6
DevKit (any version)
No other ImageMagick installation or PATH entry

第1步:
安装ImageMagick:

Step 1: Installing ImageMagick:

下载ImageMagick:
http://imagemagick.spd.co.il/binaries/ImageMagick-6.8.0-3-Q16-windows-dll.exe

Download ImageMagick: http://imagemagick.spd.co.il/binaries/ImageMagick-6.8.0-3-Q16-windows-dll.exe

安装ImageMagick:

*重要提示:安装路径不应包含任何空格。

理想情况下选择C:\ ImageMagick

Install ImageMagick:
*Important: The installation path should NOT contain any spaces.
Ideally select "C:\ImageMagick″

请确保选择以下选项:


将路径系统添加到应用程序目录中

为C和C ++安装开发头文件和库

Add application directory to your path system
Install development headers and libraries for C and C++

步骤2:
安装rmagick:

Step 2: Installing rmagick:

使用以下命令安装rmagick gem:

Use the following command to install rmagick gem:

gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagick/lib --with-opt-include=c:/ImageMagick/include

via -

http://shoobm.wordpress.com/2013/ 01/03 / installation-rmagick-gem-on-windows-7 /

这篇关于我无法在Windows上安装rmagick gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆