sh:identify命令未找到imagemagick rails 3

6

我正在使用ImageMagick-6.7.4和rails 3,并将paperclip gem安装到我的应用程序中。我按照此指南安装了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
1个回答

8
您可以尝试在您的目录中创建符号链接,以识别到usr/bin目录。
ln -s /your/imagemagick/path/identify /usr/bin/identify

1
或者将 /your/imagemagick/path 添加到 $PATH 中(但是在 Rails 应用程序的上下文中,您应该如何执行此操作)。 - Keith Thompson
非常感谢您的回复,现在我的问题已经得到解决。我进行了一些更改,现在我的身份路径是Paperclip.options[:command_path]="/opt/local/bin/",但之前我将其安装在我的主文件夹中,我不确定这是否有所不同,但现在它可以正常工作了。 - Lochana Ragupathy

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接