ImageMagick - “CORE_RL_magick_.dll 未找到”或如何在带有 ruby 1.9.2 的 Windows 上安装 RMagick
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5811388/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ImageMagick - "CORE_RL_magick_.dll not found" or how to install RMagick on windows with ruby 1.9.2
提问by bassneck
I'm working on a Rail3 app. 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. Yeah, I've heard that rails experience in windows could be painfull...
我正在开发一个 Rail3 应用程序。在挣扎了几个小时并最终在 win7x64 / ruby 1.9.2 上安装了 rmagick 2.13.1 gem 之后,我遇到了另一个错误。是的,我听说 Windows 中的 Rails 体验可能会很痛苦......
I use carrierwave to process and upload images to AWS S3. Processing looks like
我使用carrierwave 处理图像并将其上传到AWS S3。处理看起来像
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
当我在我的开发机器上触发文件上传时,它会弹出一个窗口,说
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. And this folder has several CORE_RL dlls including the magickone. The DLL's themselves are not missing!
我将 PATH 变量设置为 C:/ruby192/ImageMagick - 它是我安装 ImageMagick 的地方。这个文件夹有几个 CORE_RL dll,包括magick一个。DLL 本身并没有丢失!
irb > require 'rmagick'returns true
and convert -versionoutputs 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.
所以我有几个问题。
- How do I solve this?
elseifI don't, are there any other gems and/or graphic libraries that are supported by both windows and heroku?elsemaybe there is a way to configure carrierwave, not to process images in dev environment
- 我该如何解决这个问题?
elseif我不知道,windows 和 heroku 是否都支持其他任何 gem 和/或图形库?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 referenceerrors during the gem compilation, every test, except the first one:
到目前为止,我已经尝试过 ImageMagick v 6.6.9 32 位 dll,它给出了 CORE_RL dll 错误,64 位静态的,它没有用于编译 rmagick gem 的开发头文件,以及 64 位动态的,这给了我大量的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.
谢谢大家。
回答by bassneck
I've finally managed to install ImageMagick and build the RMagick gem and make it all work. Hooray.
我终于设法安装了 ImageMagick 并构建了 RMagick gem 并使其全部工作。万岁。
It seems like the problem was in the DLL itself. When I tried to registed it, windows gave me a nice error about a problem with the dll.
问题似乎出在 DLL 本身上。当我尝试注册它时,Windows 给了我一个关于 dll 问题的很好的错误。
So my way of solving all the issues is:
所以我解决所有问题的方法是:
- Go here
- Download ImageMagick 6.6.1-10 32bitdynamic or any other version except the currently latest release 6.6.9, which has some DLL issues
- Install it with options: Add to PATH and development headers. Installation path should not contain spaces. After the installation it should give you a message box about succesful dll registration.
In the command line type convert -version to check if everything works. It should print something like:
Version: ImageMagick 6.6.1-10 2010-05-15 Q16 http://www.imagemagick.orgCopyright: Copyright (C) 1999-2010 ImageMagick Studio LLC Features: OpenMP
Install the DevKitif you haven't already.
- Install the rmagick gem:
gem install rmagick --platform=ruby -- --with-opt-lib=c:/ruby192/ImageMagick/lib --with-opt-include=c:/ruby192/ImageMagick/include
- 去这里
- 下载 ImageMagick 6.6.1-10 32bitdynamic 或除当前最新版本 6.6.9 之外的任何其他版本,该版本存在一些 DLL 问题
- 使用选项安装它:添加到 PATH 和开发标头。安装路径不应包含空格。安装后,它应该会给你一个关于成功注册 dll 的消息框。
在命令行中输入 convert -version 来检查是否一切正常。它应该打印如下内容:
版本:ImageMagick 6.6.1-10 2010-05-15 Q16 http://www.imagemagick.org版权所有:Copyright (C) 1999-2010 ImageMagick Studio LLC 功能:OpenMP
如果您还没有安装DevKit,请安装。
- 安装 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: 1and 2if you still can't install
回答by LearningRoR
This was a pain to get installed. Right now at this moment, I had to reinstall Ruby, Rails, the Devkit and 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. At this moment I am using the latest versions:
安装起来很痛苦。此时此刻,我不得不重新安装 Ruby、Rails、Devkit 和 ImageMagick。你最好的选择是做同样的事情并使用除 Rails 之外的所有最新版本,除非你对 3.1 很酷。目前我正在使用最新版本:
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
视窗 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 中所做的,试一试,祝你好运!
回答by user3023914
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. It worked for me. You can read more about it here: rmagick not building on windows 7 undefined reference errors
我按照这篇文章中的步骤操作,但仍然有很多未定义的错误。如果这也是您的情况,您可能想尝试安装 32 版本的 imagemagick,尽管有 64 位操作系统。它对我有用。您可以在此处阅读更多相关信息:rmagick not building on windows 7 undefined reference errors
回答by 2potatocakes
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. 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. The ImageMagick installation contains the missing .dll you're after. I use it fairly frequently on a local project. Here's the link:
我很确定您在尝试在 Heroku 上运行它时也会遇到问题,因为 RMagick 只是充当与 ImageMagick 处理库交互的 gem。ImageMagick 也需要安装在本地机器上,我不知道你能在 Heroku 上安装。ImageMagick 安装包含您需要的丢失的 .dll。我在本地项目中经常使用它。这是链接:
http://www.imagemagick.org/script/binary-releases.php?ImageMagick=d1l695sitj9h0vdqs78vgebqc5#windows
http://www.imagemagick.org/script/binary-releases.php?ImageMagick=d1l695sitj9h0vdqs78vgebqc5#windows
I'd recommend installing the 64-bit "static" binary from the link above. I've ran into a problem or two trying to use the dll version.
我建议从上面的链接安装 64 位“静态”二进制文件。我在尝试使用 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.
祝一切顺利。

