【问题标题】:Rails image upload issue with Paperclip and ImageMagick - Could not run the `identify` command. Please install ImageMagickPaperclip 和 ImageMagick 的 Rails 图像上传问题 - 无法运行 `identify` 命令。请安装 ImageMagick
【发布时间】:2016-10-29 16:56:55
【问题描述】:

当我尝试在我的 Rails 应用中上传图片时,我收到了错误消息:

Could not run the `identify` command. Please install ImageMagick.

我从Link安装了ImageMagick

我遵循的步骤是:

  1. 在 gemfile 中添加了回形针
  2. bundle install
  3. 在我的模型中添加了has_attached _file
  4. rails g paperclip post image

我使用的是 Windows 7 Ultimate 64 位。

知道可能是什么问题吗?

【问题讨论】:

  • 您的 ImageMagick 版本是什么。如果您使用的是 ImageMagick 7.x.x.x,则命令已更改为“magick identify”(不带引号)

标签: ruby-on-rails ruby imagemagick paperclip


【解决方案1】:

您是否尝试在环境文件中指定 ImageMagick 路径? (development.rb 或 production.rb)。

Paperclip.options[:command_path] = "YOUR_IMAGEMAGICK_PATH"

对我来说(Linux 服务器)只需在我的 config/environments/production.rb 中插入这一行,问题就消失了!

Paperclip.options[:command_path] = "YOUR_IMAGEMAGICK_PATH"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-02-02
    • 1970-01-01
    • 1970-01-01
    • 2015-03-07
    • 1970-01-01
    • 2015-12-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多