gpt4 book ai didi

ruby-on-rails - 回形针/乘客 NotIdentifiedByImageMagickError :

转载 作者:行者123 更新时间:2023-12-04 07:33:10 26 4
gpt4 key购买 nike

当我尝试在 Ruby on Rails 上传照片时使用 Paperclip在我的本地机器上,它运行良好。

当我尝试在带有 Apache 和 CentOS 的 Linux(Phusion Passenger 5.2)服务器上使用 Paperclip 在 Ruby on Rails 中上传照片时,我得到:

2 errors prohibited this user from being saved
There were problems with the following fields:
- Avatar /tmp/stream20091026-21120-1qdbnul-0 is not recognized by the 'identify' command.
- Avatar /tmp/stream20091026-21120-1qdbnul-0 is not recognized by the 'identify' command.

我尝试添加:
Paperclip.options[:command_path] = "/usr/local/bin"

到 production.rb ,但没有任何区别。

在日志文件中,我收到以下错误:

Parameters: {"commit"=>"Upload", "action"=>"update", "_method"=>"put", "authenticity_token"=>"419410afc22737cd2f6b6096a95327db76a48ba9", "controller"=>"users", "user"=>{"avatar"=>#}} [paperclip] Saving attachments. [paperclip] An error was received while processing:

/tmp/stream20091026-20752-1g568yk-0 is not recognized by the 'identify' command.

最佳答案

识别是 ImageMagick 中的命令行实用程序包裹。
从它的主页:

The identify program describes theformat and characteristics of one ormore image files. It also reports ifan image is incomplete or corrupt. Theinformation returned includes theimage number, the file name, the widthand height of the image, whether theimage is colormapped or not, thenumber of colors in the image, thenumber of bytes in the image, theformat of the image (JPEG, PNM, etc.),and finally the number of seconds ittook to read and process the image.Many more attributes are availablewith the verbose option.


首先,复制服务器上的图像并在其上运行识别命令。你应该收到类似的东西:
identify ~/capture.jpg 
capture.jpg JPEG 1216x244 1216x244+0+0 8-bit DirectClass 97.7kb
如果收到错误,请尝试升级服务器上的 ImageMagick 包。您可以在此处找到更新的二进制版本:
http://www.imagemagick.org/script/binary-releases.php

关于ruby-on-rails - 回形针/乘客 NotIdentifiedByImageMagickError :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1623948/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com