简体   繁体   English

ImageMagick - “CORE_RL_magick_.dll not found” or how to install RMagick on windows with ruby 1.9.2

[英]ImageMagick - “CORE_RL_magick_.dll not found” or how to install RMagick on windows with ruby 1.9.2

I'm working on a Rail3 app.我正在开发 Rail3 应用程序。 After struggling for several hours and finally installing the rmagick 2.13.1 gem without errors on win7x64 / ruby 1.9.2, I've run into another error.在挣扎了几个小时并最终在 win7x64 / ruby 1.9.2 上安装 rmagick 2.13.1 gem 且没有错误后,我遇到了另一个错误。 Yeah, I've heard that rails experience in windows could be painfull...是的,我听说 windows 的 Rails 体验可能会很痛苦......

I use carrierwave to process and upload images to AWS S3.我使用 carrierwave 处理图像并将其上传到 AWS S3。 Processing looks like处理看起来像

class IconUploader < CarrierWave::Uploader::Base

require 'rmagick'
include CarrierWave::RMagick
... 
process :resize_to_fit => [100, 100]
process :convert => :png
...

When I trigger file upload on my development machine, it throws me a windows popup, saying当我在我的开发机器上触发文件上传时,它会弹出一个 windows 弹出窗口,说

CORE_RL_magick_.dll not found CORE_RL_magick_.dll 未找到

Google wasn't really helpful on this one.谷歌在这方面并没有真正的帮助。

I have my PATH variable set to C:/ruby192/ImageMagick - its where I have installed ImageMagick to.我将我的 PATH 变量设置为 C:/ruby192/ImageMagick - 这是我安装 ImageMagick 的位置。 And this folder has several CORE_RL dlls including the magick one.这个文件夹有几个 CORE_RL dll,包括magick一个。 The DLL's themselves are not missing! DLL 本身并没有丢失!

irb > require 'rmagick' returns true and convert -version outputs this: irb > require 'rmagick'返回 true 并convert -version输出:

Version: ImageMagick 6.6.9-6 2011-04-14 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP

So I have several question.所以我有几个问题。

  1. How do I solve this?我该如何解决这个问题?
  2. elseif I don't, are there any other gems and/or graphic libraries that are supported by both windows and heroku?否则,是否还有其他受elseif和 heroku 支持的 gem 和/或图形库?
  3. else maybe there is a way to configure carrierwave, not to process images in dev environment else也许有一种方法可以配置载波,而不是在开发环境中处理图像

So far I've tried ImageMagick v 6.6.9 32bit dll, which gives the CORE_RL dll error, 64 bit static, which doesn't have dev headers to compile the rmagick gem, and 64 bit dynamic, which gives me tonns of undefined reference errors during the gem compilation, every test, except the first one: So far I've tried ImageMagick v 6.6.9 32bit dll, which gives the CORE_RL dll error, 64 bit static, which doesn't have dev headers to compile the rmagick gem, and 64 bit dynamic, which gives me tonns of undefined reference gem编译期间的错误,每个测试,除了第一个:

checking for snprintf() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... yes
checking for AcquireImage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,stdint.h,sys/types.h,wand/MagickWand.h... no
and so on...

Thanks everyone.感谢大家。

I've finally managed to install ImageMagick and build the RMagick gem and make it all work.我终于设法安装了 ImageMagick 并构建了 RMagick gem 并使其一切正常。 Hooray.万岁。

It seems like the problem was in the DLL itself.似乎问题出在 DLL 本身。 When I tried to registed it, windows gave me a nice error about a problem with the dll.当我尝试注册它时,windows 给了我一个关于 dll 问题的好错误。

So my way of solving all the issues is:所以我解决所有问题的方法是:

  1. Go here Go在这里

  2. Download ImageMagick 6.6.1-10 32bit dynamic or any other version except the currently latest release 6.6.9, which has some DLL issues下载 ImageMagick 6.6.1-10 32 位动态或除当前最新版本 6.6.9 之外的任何其他版本,其中存在一些 DLL 问题

  3. Install it with options: Add to PATH and development headers.使用选项安装它:添加到 PATH 和开发标头。 Installation path should not contain spaces .安装路径不应包含空格 After the installation it should give you a message box about succesful dll registration.安装后它应该会给你一个关于 dll 注册成功的消息框。

  4. In the command line type convert -version to check if everything works.在命令行中输入 convert -version 来检查是否一切正常。 It should print something like:它应该打印如下内容:

    Version: ImageMagick 6.6.1-10 2010-05-15 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC Features: OpenMP Version: ImageMagick 6.6.1-10 2010-05-15 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC Features: OpenMP

  5. Install the DevKit if you haven't already.如果您还没有安装DevKit

  6. Install the rmagick gem: gem install rmagick --platform=ruby -- --with-opt-lib=c:/ruby192/ImageMagick/lib --with-opt-include=c:/ruby192/ImageMagick/include安装 rmagick gem: gem install rmagick --platform=ruby -- --with-opt-lib=c:/ruby192/ImageMagick/lib --with-opt-include=c:/ruby192/ImageMagick/include

It should print它应该打印

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...

And after a few minutes if everything goes right, you should see几分钟后,如果一切顺利,您应该会看到

Successfully installed rmagick-2.13.1
1 gem installed
Installing ri documentation for rmagick-2.13.1...
Installing RDoc documentation for rmagick-2.13.1...

And that's it.就是这样。 Hope this saves somebody from wasting several hours in frustration.希望这可以避免有人在沮丧中浪费几个小时。

Just two more links that were helpful: 1 and 2 if you still can't install还有两个有用的链接: 12 ,如果您仍然无法安装

This was a pain to get installed.安装起来很痛苦。 Right now at this moment, I had to reinstall Ruby, Rails, the Devkit and ImageMagick.此时此刻,我不得不重新安装 Ruby、Rails、Devkit 和 ImageMagick。 You're best bet is to do the same and go with the latest versions of all of them except Rails, unless your cool with 3.1.你最好的办法是做同样的事情,go 除了 Rails 之外,所有这些都是最新版本,除非你对 3.1 很酷。 At this moment I am using the latest versions:目前我正在使用最新版本:

ImageMagick-6.7.2-1-Q16-windows-dll - Win32 dynamic at 16 bits-per-pixel

DevKit-tdm-32-4.5.2-20110712-1620-sfx

rubyinstaller-1.9.2-p290

Rails 3.0.9

My system:我的系统:

Windows 7, x64 Windows 7, x64

My path is a little different from the accepted answer.我的路径与公认的答案略有不同。

My c:/ImageMagick我的 c:/ImageMagick

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

I installed Ruby first with all the options checked off, then ImageMagick with the "associated path option" and "headers" checked off.我首先安装了 Ruby 并检查了所有选项,然后安装了 ImageMagick 并检查了“关联路径选项”和“标题”。

Then set up the devkit easily:然后轻松设置 devkit:

1) cd c:\DevKit
2) ruby dk.rb init
3) ruby dk.rb install

Then afterwards inside of the devkit (c:/devkit) did this and it installed without error:然后在 devkit (c:/devkit) 内部做了这个并且安装没有错误:

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

If you still have issues then maybe this could help you, I was trying this but I am to unfamiliar with setting the environments and getting Step 5 to work: http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/如果您仍然有问题,那么也许这可以帮助您,我正在尝试这个,但我不熟悉设置环境并让第 5 步工作: http://www.waydotnet.com/blog/2010/02/rmagick- on-ruby-1-9-1-i386-mingw32-work-d/

The Step 5 I believe can be changed into what i did inside of the Devkit instead, give it a try and good luck!我相信第 5 步可以改为我在 Devkit 中所做的,试一试,祝你好运!

I followed the steps on this post, but still got a lof of undefined errors.我按照这篇文章的步骤进行操作,但仍然遇到很多未定义的错误。 If this is your case as well you might want to try installing the 32 version of imagemagick, despite of having a 64 bit operating system.如果您也是这种情况,您可能想尝试安装 32 版本的 imagemagick,尽管您拥有 64 位操作系统。 It worked for me.它对我有用。 You can read more about it here: rmagick not building on windows 7 undefined reference errors你可以在这里阅读更多相关信息: rmagick not build on windows 7 undefined reference errors

I'm pretty sure you're going to run into problems trying to run it on Heroku as well because RMagick just acts as a gem to interface with the ImageMagick processing libraries.我很确定您在尝试在 Heroku 上运行它时也会遇到问题,因为 RMagick 只是充当与 ImageMagick 处理库接口的宝石。 ImageMagick needs to also be installed on the local machine as well, which I don't know you'll be able to do on Heroku. ImageMagick 也需要安装在本地机器上,我不知道你能在 Heroku 上安装。 The ImageMagick installation contains the missing.dll you're after. ImageMagick 安装包含缺少的.dll 您所追求的。 I use it fairly frequently on a local project.我在本地项目中经常使用它。 Here's the link:这是链接:

Link 关联

I'd recommend installing the 64-bit "static" binary from the link above.我建议从上面的链接安装 64 位“静态”二进制文件。 I've ran into a problem or two trying to use the dll version.我在尝试使用 dll 版本时遇到了一两个问题。

Anyways download it, install it and then add your C:\Program Files\ImageMagick-6.5.6-Q8 (Or wherever yours is installed to) path to your PATH environment variable.无论如何下载它,安装它,然后将您的 C:\Program Files\ImageMagick-6.5.6-Q8 (或安装到您的任何位置)路径添加到您的 PATH 环境变量。

You should then be able to use your RMagick gem properly.然后您应该能够正确使用您的 RMagick gem。

All the best.一切顺利。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM