Ruby 1.9.2 如何在 Windows 上安装 RMagick? [英] Ruby 1.9.2 how to install RMagick on Windows?

查看:18
本文介绍了Ruby 1.9.2 如何在 Windows 上安装 RMagick?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在升级旧的 Rails 应用程序以使用 Rails 3 和 Ruby 1.9.2,而 RMagick 是我需要安装的最后一个 gem.但是,似乎没有任何适用于 Windows 的 1.9.2 下载,并且标准 gem 安装 RMagick 不起作用.

I'm currently upgrading an old rails app to use Rails 3 and Ruby 1.9.2, and RMagick is the last gem I need to install. However there doesn't seem to be any 1.9.2 downloads for Windows and the standard gem install RMagick doesn't work.

有人可以为我指出如何安装此 gem 的正确方向吗?

Could someone point me in the right direction on how to install this gem?

推荐答案

我刚刚用Ruby v1.9.x在Windows上成功安装了RMagick 2.13.1!

I just installed RMagick 2.13.1 successfully on Windows with Ruby v1.9.x !

在我忘记之前,让我把程序说出来.

Let me spill out the procedure, before I forget.

  1. 安装 DevKit:https://github.com/oneclick/rubyinstaller/wiki/Development-工具包 .
  2. 使用带有标题的 Windows 安装程序安装 ImageMagick 6.6.x.
    注意:
    - 不要将 ImageMagick 安装在有空格的路径中.
    默认路径 C:/Program Files/... 将不起作用.
    安装在更简单的路径.
    -- 删除所有旧版 ImageMagick 和 RMagick
  3. 在环境变量中设置路径:

  1. Install DevKit : https://github.com/oneclick/rubyinstaller/wiki/Development-Kit .
  2. Install ImageMagick 6.6.x with windows installer with headers.
    NOTE:
    -Do not install ImageMagick in a path which has spaces in it.
    The default path C:/Program Files/... will not work.
    Install it at a simpler path.
    -- Remove any older installations of ImageMagick and RMagick
  3. Set the paths in Environment Variables:

将 DFImageMagick 环境变量设置为 ImageMagick 的安装位置
设置 PATH=%DFImageMagick%;%PATH%(如果 PATH 中还没有它)
设置 CPATH=%DFImageMagick%include;%CPATH%
设置 LIBRARY_PATH=%DFImageMagick%lib;%LIBRARY_PATH%

set DFImageMagick environment variable to where ImageMagick is installed
set PATH=%DFImageMagick%;%PATH% (if you don't already have it in PATH)
set CPATH=%DFImageMagick%include;%CPATH%
set LIBRARY_PATH=%DFImageMagick%lib;%LIBRARY_PATH%

安装 RMagick gem:宝石安装 rmagick
这应该说,暂时增强 PATH 以包含 DevKit...构建原生扩展.这可能需要一段时间...一段时间后,成功安装了rmagick 2.13.1

Install RMagick gem : gem install rmagick
This should say, Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... After some time, Successfully installed rmagick 2.13.1

验证安装:

A.转换-版本
这应该给出 ImageMagick 安装版本
B. gem list --local 应该列出 rmagick 2.13.1
替代方案:在 irb 中,尝试
需要'rmagick'
它应该返回真"

A. convert -version
this should give the ImageMagick installation version
B. gem list --local should list rmagick 2.13.1
Alternative: in irb, try
require 'rmagick'
it should return 'true'

哦,我确实喜欢分 5 步完成的安装.

Oh, I do like installations which complete in 5 steps.

希望这对你和其他人有用.

Hope this works for you and others.

参考:

http://www.ruby-forum.com/topic/204353#new

http://www.waydotnet.com/blog/2010/02/rmagick-on-ruby-1-9-1-i386-mingw32-work-d/#链接文字

这篇关于Ruby 1.9.2 如何在 Windows 上安装 RMagick?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆