gpt4 book ai didi

ruby - Rmagic 不适用于 Rails3

转载 作者:太空宇宙 更新时间:2023-11-03 16:38:34 30 4
gpt4 key购买 nike

我的 Rmagic 不工作

ruby -v

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

rails -v

轨道 3.0.0.beta4

irb

require rubygems

正确

require rmagick

正确

但是,我放了流程代码:

gem 'rmagick', :require => false

错误:

checking for Ruby version >= 1.8.5... yeschecking for stdint.h... nochecking for sys/types.h... nochecking for wand/MagickWand.h... noCan't install RMagick 2.13.1. Can't find MagickWand.h.*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers.  Check the mkmf.log file for moredetails.  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/rubyGem 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

请帮助我,谢谢!

最佳答案

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 而不是尝试安装新的。

关于ruby - Rmagic 不适用于 Rails3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3745080/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com