【发布时间】:2011-12-14 01:23:00
【问题描述】:
我在 Rails 3.1 中使用回形针。当我添加图片时,它会显示原始尺寸,但不会显示拇指或中等尺寸:
这是我的看法:
<%= image_tag @image.avatar.url(:thumb) %>
<%= image_tag @image.avatar.url(:medium) %>
图像.rb
has_attached_file :avatar, :whiny => false, :styles => { :medium => "300x300>", :thumb => "100x100>" }
更新:
这是我在使用:whiny => true 时遇到的错误
命令 :: identify -format %wx%h '/var/folders/54/txjcl9l130j6dq73r37hf2c00000gn/T/stream20111213-9180-1plu1me.png[0]' [回形针] 处理时收到错误:#
命令 :: identify -format %wx%h '/var/folders/54/txjcl9l130j6dq73r37hf2c00000gn/T/stream20111213-9180-1plu1me.png[0]' [回形针] 处理时收到错误:# 在布局/应用程序中渲染图像/new.html.erb (4.0ms)
【问题讨论】:
-
考虑到您有
:whiny => false,在缩略图创建过程中很可能会发生异常。尝试设置:whiny => true并发布您遇到的任何错误。我的猜测:没有安装 image magic,或者 Rails 不知道在哪里可以找到它,因为你的path没有设置。
标签: ruby-on-rails ruby-on-rails-3 paperclip