【问题标题】:sh: identify: command not found imagemagick rails 3sh:识别:找不到命令 imagemagick rails 3
【发布时间】:2020-12-05 01:48:06
【问题描述】:

我正在使用带有 rails 3 的 ImageMagick-6.7.4,并且还在我的应用程序中安装了 paperclip gem。我跟着this guide 安装imagemagick,它可以在我的终端上运行,但不能在我的rails 应用程序中运行。我在 development.rb 中包含了 identify 命令的路径

Paperclip.options[:command_path]='/path-where-my-identify-got-installed/'

但它仍然给我一个错误

Command :: identify -format %wx%h'/var/folders/Cd/CdjXsnlyEPyFqs4pwH83T++++TI/-Tmp-/stream20120104-2402-5iizym-0.png[0]'[paperclip] An error was received while processing: #<Paperclip::CommandNotFoundError: Could not run the `identify` command. 
Please installImageMagick.>Command :: identify -format %wx%h '/var/folders/Cd/CdjXsnlyEPyFqs4pwH83T++++TI/-Tmp-/stream20120104-2402-5iizym-0.png[0]'[paperclip] An error was received while processing: #<Paperclip::CommandNotFoundError: Could not run the `identify` command. Please install ImageMagick.>SQL (0.1ms)  BEGIN

【问题讨论】:

    标签: ruby-on-rails imagemagick


    【解决方案1】:

    您可以尝试制作符号链接以识别从您的目录到 usr/bin 目录。

    ln -s /your/imagemagick/path/identify /usr/bin/identify
    

    【讨论】:

    • 或者将/your/imagemagick/path 添加到$PATH(但是你可以在Rails 应用程序的上下文中这样做)。
    • 非常感谢您的回复,现在更改对我来说一切正常,现在我的身份路径是 Paperclip.options[:command_path]="/opt/local/bin/" 但以前我有将它安装在我的主文件夹中我不确定这是否有所不同,但它现在可以工作了
    猜你喜欢
    • 1970-01-01
    • 2021-07-07
    • 2019-08-10
    • 2021-11-13
    • 2019-04-19
    • 2013-05-16
    • 2018-08-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多