ImageMagick - “未找到 CORE_RL_magick_.dll”或者如何使用 ruby​​ 1.9.2 在 Windows 上安装 RMagick

发布于 2024-11-03 17:45:46 字数 1568 浏览 1 评论 0原文

我正在开发 Rail3 应用程序。 经过几个小时的努力,终于在 win7x64 / ruby​​ 1.9.2 上安装了 rmagick 2.13.1 gem,没有错误,我遇到了另一个错误。是的,我听说 Windows 中的 Rails 体验可能会很痛苦...

我使用 Carrierwave 来处理图像并将其上传到 AWS S3。 处理过程看起来像

class IconUploader < CarrierWave::Uploader::Base

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

当我在开发计算机上触发文件上传时,它会弹出一个窗口,显示

未找到 CORE_RL_magick_.dll

Google 在这方面并没有真正提供帮助。

我将 PATH 变量设置为 C:/ruby192/ImageMagick - 它是我安装 ImageMagick 的位置。此文件夹有几个 CORE_RL dll,其中包括 magick 一个。 DLL本身并没有丢失!

irb >要求 '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

所以我有几个问题。

  1. 我该如何解决这个问题?
  2. elseif 我不知道,还有 Windows 和 Heroku 都支持的其他 gem 和/或图形库吗?
  3. else也许有一种方法可以配置载波,而不是在开发环境中处理图像

到目前为止,我已经尝试过ImageMagick v 6.6.9 32位dll,它给出了CORE_RL dll错误, 64 位静态,没有用于编译 rmagick gem 的开发标头, 和 64 位动态,这在 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...

谢谢大家。

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...

I use carrierwave to process and upload images to 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

CORE_RL_magick_.dll not found

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 magick one. The DLL's themselves are not missing!

irb > require 'rmagick' returns true
and convert -version outputs this:

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?
  3. else maybe there is a way to configure carrierwave, not to process images in dev environment

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:

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

没︽人懂的悲伤 2024-11-10 17:45:47

我终于成功安装了 ImageMagick 并构建了 RMagick gem 并使其一切正常工作。万岁。

看来问题出在 DLL 本身上。当我尝试注册它时,Windows 给了我一个关于 dll 问题的错误。

所以我解决所有问题的方法是:

  1. 转到这里< /p>

  2. 下载 ImageMagick 6.6.1-10 32 位动态或任何其他版本除了当前最新版本6.6.9,该版本存在一些DLL问题

  3. 使用选项安装:添加路径和开发头文件。 安装路径不应包含空格
    安装完成后,它应该会显示一个有关 dll 注册成功的消息框。

  4. 在命令行中输入convert -version 以检查是否一切正常。它应该打印如下内容:

    版本:ImageMagick 6.6.1-10 2010-05-15 Q16 http://www.imagemagick.org
    版权所有:版权所有 (C) 1999-2010 ImageMagick Studio LLC
    特点:OpenMP


  5. 安装 DevKit(如果尚未安装)。

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

它应该打印

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

几分钟后,如果一切顺利,您应该看到

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...

就这样了。希望这可以帮助人们避免在沮丧中浪费几个小时。

还有两个有用的链接: 12如果仍然无法安装

I've finally managed to install ImageMagick and build the RMagick gem and make it all work. Hooray.

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.

So my way of solving all the issues is:

  1. Go here

  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

  3. 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.

  4. 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.org
    Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
    Features: OpenMP

  5. Install the DevKit if you haven't already.

  6. Install the 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

森末i 2024-11-10 17:45:47

安装起来很痛苦。此时此刻,我必须重新安装 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

我的系统:

Windows 7,x64

我的路径与接受的答案有点不同。

我的 c:/ImageMagick

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

我首先安装了 Ruby,选中了所有选项,然后安装了 ImageMagick,选中了“关联路径选项”和“标题”。

然后轻松设置 devkit:

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

然后在 devkit (c:/devkit) 内部执行此操作并且安装没有错误:

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

如果您仍然有问题,那么也许这可以帮助您,我正在尝试这样做,但我不熟悉设置环境并让第 5 步开始工作:http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/

步骤 5我相信可以改为我在 Devkit 中所做的,尝试一下,祝你好运!

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:

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

My path is a little different from the accepted answer.

My 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.

Then set up the devkit easily:

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:

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/

The Step 5 I believe can be changed into what i did inside of the Devkit instead, give it a try and good luck!

Saygoodbye 2024-11-10 17:45:47

我按照这篇文章中的步骤操作,但仍然遇到许多未定义的错误。如果您也是这种情况,尽管您使用的是 64 位操作系统,但您可能仍想尝试安装 32 版本的 imagemagick。这对我有用。
您可以在这里阅读更多相关信息: rmagick 不在 Windows 7 上构建未定义的引用错误

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

戒ㄋ 2024-11-10 17:45:47

我很确定在 Heroku 上运行它时您也会遇到问题,因为 RMagick 只是充当与 ImageMagick 处理库交互的 gem。 ImageMagick 还需要安装在本地计算机上,我不知道您是否能够在 Heroku 上执行此操作。 ImageMagick 安装包含您需要的缺少的 .dll。我在本地项目中经常使用它。这是链接:

链接

我建议安装 64来自上面链接的-bit“静态”二进制文件。我在尝试使用 dll 版本时遇到了一两个问题。

无论如何,下载它,安装它,然后将 C:\Program Files\ImageMagick-6.5.6-Q8 (或您的安装位置)路径添加到 PATH 环境变量。

然后您应该能够正确使用 RMagick gem。

一切顺利。

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:

Link

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.

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.

You should then be able to use your RMagick gem properly.

All the best.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文