Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 回形针::未通过Spree中的ImageMagickeror识别::管理::ImagesController#创建_Ruby On Rails_Imagemagick_Paperclip_Spree - Fatal编程技术网

Ruby on rails 回形针::未通过Spree中的ImageMagickeror识别::管理::ImagesController#创建

Ruby on rails 回形针::未通过Spree中的ImageMagickeror识别::管理::ImagesController#创建,ruby-on-rails,imagemagick,paperclip,spree,Ruby On Rails,Imagemagick,Paperclip,Spree,我第一次尝试设置Spree。一切都很顺利,直到我点击图片上传。我已经在Mac OSX Mountain Lion上使用自制软件安装了Imageamgick。上传任何图像都会导致以下错误 Paperclip::NotIdentifiedByImageMagickError in Spree::Admin::ImagesController#create Command :: identify -format %wx%h :file [paperclip] An error was rec

我第一次尝试设置Spree。一切都很顺利,直到我点击图片上传。我已经在Mac OSX Mountain Lion上使用自制软件安装了Imageamgick。上传任何图像都会导致以下错误

Paperclip::NotIdentifiedByImageMagickError in Spree::Admin::ImagesController#create

    Command :: identify -format %wx%h :file
[paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /var/folders/fq/9g_6hmg513g6137rb6sbghw00000gn/T/stream20121005-26943-16883d4.png is not recognized by the 'identify' command.>

Paperclip::NotIdentifiedByImageMagickError (/var/folders/fq/9g_6hmg513g6137rb6sbghw00000gn/T/stream20121005-26943-16883d4.png is not recognized by the 'identify' command.):
  paperclip (2.7.1) lib/paperclip/geometry.rb:29:in `from_file'
  spree_core (1.2.0) app/models/spree/image.rb:35:in `find_dimensions'
  activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `_run__1794851703999987262__post_process__1580526166879208018__callbacks'
任何帮助都将不胜感激

谢谢,
Cory

检查png格式是否在已编译格式列表中,以确定:

identify -list format
如果不是,则可能需要使用以下选项重新编译:

./configure --prefix=/usr/local --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes

我的错误是-“纸夹::未通过Spree::Admin::ImagesController中的ImageMagickeror识别”

我几天前修复了这个错误

在此之前,我尝试:

  • 更新XCode(使用命令行工具)
  • 更新Imagemagick(我从源代码和二进制模块中进行了尝试)
  • 更新MacPort
  • 使用Brew(刷新Imagemagic的所有依赖项, 使用“brew医生”),而不是MacPort
  • 重新安装所有使用Imagemagick的gems
  • 包更新
当然,我在production.rb文件中有指向Imagemagick bin文件夹的“回形针::Attachment.default_options[:command_path]”选项

好几次,我从a到z,一次又一次

但是什么也帮不了我

顺便说一句,在所有情况下,我都能很好地“转换”、“识别”和“显示”任何类型的测试图像,但在我的rails应用程序(spree应用程序)中却不行

我潜入北斗七星,试图用它在轨道控制台内进行研究

Paperclip.run("identify", "-format %m :file", :file => "/path/to/image”) 
就像回形针一样。并且此命令只有新格式(0.4):

Paperclip.run("identify", "-format %m /path/to/image")
工作很好

因此,我发现可卡因0.4是我问题的根源。我在Gemfile中尝试降级到可卡因0.3.2,我的Spree应用程序开始工作


我需要做的就是使用可卡因0.3.2而不是0.4

当公用文件夹中不存在图像文件时,我也遇到了问题。
我刚刚复制了一个同名的随机文件,一切都开始工作了

parepclip 2.7.5 cocain 0.3.2

它似乎是PNG24*PNG rw-不透明24位RGB(zlib 1.2.5)PNG32*PNG rw-不透明或透明32位RGBA PNG8*PNG rw-8位索引可选二进制透明我通过自制升级了imagemagick的安装,并且它再次工作。感谢Leonid解决了这个问题。你是否向Spree和/或Cokine项目提交了错误报告?此外,你可能可以将回形针2.7升级到2.8来修复它。如果回形针在提供答案之前不尝试讲述这么长时间的故事,答案会更好。如果你觉得有帮助的话,先给出答案,然后提供一些背景知识。
parepclip 2.7.5 cocain 0.3.2