Windows 7上的Paperclip :: Errors :: NotIdentifiedByImageMagickError [英] Paperclip::Errors::NotIdentifiedByImageMagickError on Windows 7

查看:92
本文介绍了Windows 7上的Paperclip :: Errors :: NotIdentifiedByImageMagickError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过Mattan Griffel的One Month Rails( http://onemonthrails.com/ )课程。我正在尝试使用paperclip gem上传图片。初始安装和使用情况很好,直到他添加了一行来减少图像的大小。这被放置在app / models / pin.rb中,如他的教程中所示:

I'm going through Mattan Griffel's "One Month Rails" (http://onemonthrails.com/) class. I'm trying to use the paperclip gem to upload images. Initial install and usage went fine, until he added a line to reduce the size of images. This was placed in app/models/pin.rb as shown in his tutorial:

    has_attached_file :image, styles: { medium: "320x240>" }

直到添加了样式:{}部分才有效。我还更新了我的部分传递:medium方法。

It worked until the styles: {} part was added. I have also updated my partial to pass in the :medium method.

我正在使用:paperclip(3.4.1),可卡因(0.5.1)和rails( 3.2.12)。我已经看到其他帖子用自制软件修复了,但我在Windows 7机器上,我相当确定不适用。如果我需要发布任何其他内容,请告诉我。

I'm using: paperclip (3.4.1),cocaine (0.5.1) and rails (3.2.12). I have seen other posts where this was fixed with homebrew, but I'm on a Windows 7 machine and I'm fairly certain that doesn't apply. Let me know if I need to post anything else.

推荐答案

我正在遵循相同的课程。经过几次宝石更改(尝试旧版本的可卡因,等等......)解决我问题的方法是将此行添加到pin.rb:

I'm following the same course. After several gem changes (trying older versions of cocaine, etcetera...) the thing that solved my problem was adding this line to pin.rb:

Paperclip.options[:command_path] = 'C:/Program Files/ImageMagick-6.8.5-Q16'

belongs_to:user

之前(更改图像magick安装路径的路径)

(change the path for your image magick install path)

在此之后,运行捆绑包更新并重置rails服务器。

After this, run a bundle update and reset your rails server.

这篇关于Windows 7上的Paperclip :: Errors :: NotIdentifiedByImageMagickError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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