Rmagic 不适用于 Rails3 [英] Rmagic isn't work on Rails3

查看:48
本文介绍了Rmagic 不适用于 Rails3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Rmagic 不工作

<块引用>

红宝石 -v

ruby 1.8.7 (2010-01-10 补丁级别 249) [i386-mingw32]

<块引用>

导轨 -v

Rails 3.0.0.beta4

<块引用>

irb

需要 ruby​​gems

真实

<块引用>

需要 rmagick

真实

但是,我把流程代码:

<块引用>

gem 'rmagick', :require =>假

错误:

<前>检查 Ruby 版本 >= 1.8.5 ... 是检查 stdint.h... 否检查 sys/types.h... 否检查魔杖/MagickWand.h...没有无法安装 RMagick 2.13.1.找不到 MagickWand.h.*** extconf.rb 失败 ***由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件.检查 mkmf.log 文件以获取更多信息细节.您可能需要配置选项.提供的配置选项:--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:/Ruby/bin/rubyGem 文件将保留安装在 C:/Ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1 中以供检查.结果记录到 C:/Ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out来自 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'来自 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'来自 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `run'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in `install'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `send'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start'来自 C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/bin/bundle:13来自 C:/Ruby/bin/bundle:19:in `load'来自 C:/Ruby/bin/bundle:19

请帮帮我,谢谢!

解决方案

MagickWand.h 是 ImageMagick 和 RMagick 安装程序找不到它.看来您需要在您的系统上安装 ImageMagick,或者如果您安装了它,您需要将库添加到 gem 安装程序可以看到的路径中.如果您的系统上没有安装 ImageMagick 或 GraphicsMagick,RMagick 将无法工作.

更新的答案由于您使用的是 Windows,因此您需要手动下载 gem 并安装它.安装常见问题解答说:

使用 rmagick-win32 gem.此 gem 与 ImageMagick Windows 安装程序的副本捆绑在一起,因此您无需下载自己的副本.从 RubyForge 上的 RMagick 项目页面下载 rmagick-win32 gem,将其解压缩到一个临时目录中,然后按照包中的 README.html 文件中的说明进行操作.

http://rubyforge.org/projects/rmagick/

我想您可能想卸载已经安装的 imagemagick 版本,以防出现任何冲突.手动安装 gem 后,您应该能够将其放入 Gemfile 并进行捆绑安装.没有在 Windows 上使用过 rmagick,我不确定您是否将 gem 称为rmagick".或rmagick-win32".手动安装 gem 后,您可能可以通过运行gem list"来解决这个问题.命令.看看哪一个出现并把它放在你的 Gemfile 中,这样它就可以找到安装的版本.. Bundler 将使用这个 gem 而不是尝试安装一个新的.

My Rmagic isn't work

ruby -v

ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]

rails -v

Rails 3.0.0.beta4

irb

require rubygems

true

require rmagick

true

but , I put the fllow code:

gem 'rmagick', :require => false

it error:

checking for Ruby version >= 1.8.5... yes
checking for stdint.h... no
checking for sys/types.h... no
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.1. Can't find MagickWand.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:/Ruby/bin/ruby


Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
        from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
        from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
        from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `run'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in `install'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `send'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start'
        from C:/Ruby/lib/ruby/gems/1.8/gems/bundler-1.0.0/bin/bundle:13
        from C:/Ruby/bin/bundle:19:in `load'
        from C:/Ruby/bin/bundle:19

please help me , thanks !

解决方案

MagickWand.h is part of ImageMagick and the RMagick installer can't find it. It appears that you need to install ImageMagick on your system or if you have it installed you need to add the libraries to a path that the gem installer can see. RMagick will not work without ImageMagick or GraphicsMagick installed on your system.

UPDATED ANSWER Since you are using windows you will need to download the gem manually and install it. The installation FAQ says:

Use the rmagick-win32 gem. This gem is bundled with a a copy of the ImageMagick Windows installer so you don't need to download your own copy. Download the rmagick-win32 gem from the RMagick project page on RubyForge, unzip it into a temporary directory, and follow the instructions in the README.html file you'll find in the package.

http://rubyforge.org/projects/rmagick/

I am thinking that you probably want to uninstall the imagemagick version that you already installed, in case there are any conflicts. After you install the gem manually, you should be able to put it in your Gemfile and bundle install. Having not used rmagick on windows, I am not sure if you reference the gem as "rmagick" or "rmagick-win32". After you install the gem manually, you can probably figure that out by running the "gem list" command. See which one shows up and put that in your Gemfile, so it can find the installed version.. Bundler will use this gem instead of trying to install a new one.

这篇关于Rmagic 不适用于 Rails3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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