我使用回形針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用於處理圖像.... 有什麼我要在我的環境文件中設置。
在此先感謝.....
你嘗試在這個[提問]答案(http://stackoverflow.com/questions/1996102/rails-paperclip-and-passenger-is - 不是認可由這-識別命令)? – cbascom
我正在使用Windows 7,我設置Paperclip.options [:command_path] =「C:\ ImageMagick-6.8.0-Q16」的路徑,我仍然收到相同的錯誤。 – Cyber
如果用/替換該路徑中的\,是否會有所作爲? – cbascom