【问题标题】:All of a sudden paperclip won't work突然回形针不起作用
【发布时间】:2013-09-26 13:36:36
【问题描述】:

照片无法运行identify 命令。请安装 ImageMagick。

Paperclip 在开发中一直运行良好,但突然我无法上传照片.. 没有安装 imagemagic,但它更早地工作。有人知道吗?

这是我的控制台错误:

 Setting Load (0.1ms)  SELECT "settings".* FROM "settings" WHERE "settings"."id" = ? LIMIT 1  [["id", "14"]]
   (0.1ms)  begin transaction
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/ubuntu_wallpaper_by_hyarmenadan-d54zgpm20130926-11024-9efnnx.jpg[0]'
[paperclip] An error was received while processing: #<Paperclip::Errors::CommandNotFoundError: Could not run the `identify` command. Please install ImageMagick.>
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/ubuntu_wallpaper_by_hyarmenadan-d54zgpm20130926-11024-9efnnx.jpg[0]'
[paperclip] An error was received while processing: #<Paperclip::Errors::CommandNotFoundError: Could not run the `identify` command. Please install ImageMagick.>
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/ubuntu_wallpaper_by_hyarmenadan-d54zgpm20130926-11024-9efnnx.jpg[0]'
[paperclip] An error was received while processing: #<Paperclip::Errors::CommandNotFoundError: Could not run the `identify` command. Please install ImageMagick.>

【问题讨论】:

    标签: ruby-on-rails ruby paperclip ruby-on-rails-4


    【解决方案1】:

    Paperclip 使用 ImageMagick,所以你在可以使用回形针之前就有了它。

    ImageMagick 是很多软件的依赖项,所以它可能是由其他软件包安装的,然后在使用 apt-get autoremove 之类的东西时被删除。

    无论如何,您必须为回形针安装 ImageMagick 才能使用其 identifyconvert 二进制文件:

    apt-get install imagemagick
    

    identify 二进制文件用于检索图像的大小(即:您的原始图像,用于存储其大小并可能对其进行验证)。

    convert 二进制文件用于更改图像,例如调整图像大小或更改格式(jpg、png 等)......在许多可能的转换中。有关完整详细信息,请参阅其手册页。

    【讨论】:

    • 啊,好吧,将在我的 gem 目录中查找。我的 gemfile 中没有 imageMagick gem。识别方法有什么作用?
    • ImageMagick 不是 gem,它是一个系统包。 apt-get install imagemagick ?
    猜你喜欢
    • 2014-11-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多