我正在使用回形针版本 3.xx 上传图片。当我尝试上传图片时出现 2 个错误,
Avatar C:/Users/ABC~1/AppData/Local/Temp/PNG_transparency_demonstration_120121214-6968-3t461n.png is not recognized by the 'identify' command.
Avatar C:/Users/ABC~1/AppData/Local/Temp/PNG_transparency_demonstration_120121214-6968-3t461n.png is not recognized by the 'identify' command.
我的模特,
class User < ActiveRecord::Base
attr_accessible :name , :avatar
has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }
end
看法
<%= form_for @user , :url => users_path, :html => { :multipart => true } do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div>
<%= f.file_field :avatar %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>
我正在使用 ImageMagic 处理图像.... 有什么我必须在我的环境文件中设置的。
提前致谢.....