【问题标题】:ImageMagick version cannot be found - rmagick install fails找不到 ImageMagick 版本 - rmagick 安装失败
【发布时间】:2012-08-19 15:28:26
【问题描述】:

超级困惑和第一次 Ruby 用户...我已经安装了 rmagick,如下所示:

actionmailer (3.2.6)
actionpack (3.2.6)
activemodel (3.2.6)
activerecord (3.2.6)
activeresource (3.2.6)
activesupport (3.2.6)
arel (3.0.2)
builder (3.0.0)
bundler (1.1.5)
cgi_multipart_eof_fix (2.5.0)
coderay (1.0.7)
erubis (2.7.0)
fastercsv (1.5.5)
gem_plugin (0.2.3)
hike (1.2.1)
i18n (0.6.0, 0.4.2)
journey (1.0.4)
json (1.7.5)
mail (2.4.4)
metaclass (0.0.1)
mime-types (1.19)
mocha (0.12.3)
mongrel (1.1.5 x86-mingw32)
mongrel_service (0.3.4 i386-mswin32)
multi_json (1.3.6)
mysql (2.8.1 x86-mingw32)
net-ldap (0.3.1)
pg (0.14.0 x86-mingw32)
polyglot (0.3.3)
prototype-rails (3.2.1)
rack (1.4.1)
rack-cache (1.2)
rack-openid (1.3.1)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.6)
railties (3.2.6)
rake (0.9.2.2)
rdoc (3.12)
rmagick (2.12.0 mswin32)
ruby-openid (2.1.8)
sprockets (2.1.3)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)
win32-service (0.5.2 mswin32)

但是当我运行 bundle install 时。它给了我这个输出。

Fetching gem metadata from http://rubygems.org/.......
Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.3.6) 
Using activesupport (3.2.6) 
Using builder (3.0.0) 
Using activemodel (3.2.6) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.1) 
Using rack-cache (1.2) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.3) 
Using actionpack (3.2.6) 
Using mime-types (1.19) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.4.4) 
Using actionmailer (3.2.6) 
Using arel (3.0.2) 
Using tzinfo (0.3.33) 
Using activerecord (3.2.6) 
Using activeresource (3.2.6) 
Using bundler (1.1.5) 
Using coderay (1.0.7) 
Using fastercsv (1.5.5) 
Using json (1.7.5) 
Using metaclass (0.0.1) 
Using mocha (0.12.3) 
Using mysql (2.8.1) 
Using net-ldap (0.3.1) 
Using pg (0.14.0) 
Using rack-ssl (1.3.2) 
Using rdoc (3.12) 
Using thor (0.16.0) 
Using railties (3.2.6) 
Using rails (3.2.6) 
Using prototype-rails (3.2.1) 
Using ruby-openid (2.1.8) 
Using rack-openid (1.3.1) 
Installing rmagick (2.13.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

C:/wamp/ruby/bin/ruby.exe extconf.rb 
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** 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:/wamp/ruby/bin/ruby


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

请注意,我正在尝试完成 redmine 安装,并且需要 rmagick 才能继续使用 rake。

我的 ruby​​ 版本是 1.8.7,rubygem 版本是 1.3.7。谢谢。

更新:

所以在听说我现有的 rmagick 是旧版本后,我运行了:

gem uninstall rmagick

并成功卸载了我现有的 gem。之后我再次尝试进行捆绑安装,但失败与以前完全相同。

但这一次我去了我的文件夹 (C:\wamp\ruby\lib\ruby\gems\1.8\gems\rmagick-2.13.1),它说文件仍将被存储。在那里我通过

运行了一个新版本
gem build rmagick.gemspec

构建成功了,所以我认为我们正在取得进展。我跑了:

gem install rmagick-2.13.1.gem --platform=ruby -- --with-opt-lib=c:\ImageMagick\6.3.5-Q8\lib --with-opt-include=c:\ImageMagick\6.3.5-Q8\include

并得到了这个输出(请注意,我不再得到无效的驱动器,但这与之前相同):

checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** 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:/wamp/ruby/bin/ruby


Gem files will remain installed in C:/wamp/ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to C:/wamp/ruby/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

所以现在我正在研究为什么它无法确定 ImageMagick 版本...

【问题讨论】:

  • 根据我在 mkmf.log 下方的评论只有这个:检查 Ruby 版本 >= 1.8.5... ------------------ -- 是的--------

标签: ruby-on-rails ruby rake redmine rmagick


【解决方案1】:

有一个旧版本的 rmagick,虽然 bundler 尝试安装一个新版本。新版本的构建出了点问题。您应该检查日志文件以找出原因。

【讨论】:

  • 我的 mkmf.log 的范围正在检查 Ruby 版本 >= 1.8.5... -------------------- 是 - -------------------
  • 只有一行?我猜错误信息“无效的驱动器规格。无法获得 ImageMagick 版本”对于解决这个问题很重要。我不确定这意味着什么。我在窗户上没有红宝石。在我的 OS X 上,检查 ruby​​ 版本后,下一步是检测 gcc。
  • 如果您有时间,请查看我的更新。我现在奇迹般地通过了无效的驱动器规范。 :)
  • 抱歉,我仍然无法确定问题所在。这是我的猜测:在查看 ruby​​forge 上关于在 windows 上安装 rmagick 的信息后,建议 rmagick 和 ImageMagick 都只在 windows 上通过特殊的 gem 安装(包括一些 exe 文件)。但是这个特殊的 gem 只有 2.12 版本。也许你需要一个 cygwin 环境来编译 2.13 gem。
【解决方案2】:

ImageMagick 是一个本地库,RMagick 使用它来处理图像。您的 ImageMagick 安装似乎有问题,并且 RMagick 无法检测到您的环境中安装的 ImageMagick 版本。

在控制台上,当您键入“识别”时,您是否有应用程序的输出或只是找不到文件错误?

【讨论】:

  • 我在命令提示符中输入“identify”的输出是:版本:ImageMagick 6.3.5 08/10/07 QA imagemagick.org ... 以及一些其他帮助信息。
  • 你有 mkmf.log 的要点吗?谢谢。
【解决方案3】:

虽然这可能无法完全回答问题……但作为一个新手用户,我可能在某些时候安装失败了。

回溯和卸载我之前安装的所有内容,然后按照installation instructions 再次解决问题。

请注意,这一次,即使在它说“尽管未来的版本也应该可以工作”的部分,我反而指定了在撰写本文时文章中提到的确切版本。

【讨论】:

  • 如果您在使用 rmagic/ImageMagick 源时遇到问题,请将 ImageMagick 重新安装到旧版本 - 我已经成功捆绑了从 6.8.8 重新安装到 6.6.7 的 ImageMagick
猜你喜欢
  • 2011-04-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-22
  • 2012-07-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多