2016-08-26 32 views
0

我在使用回形針GEM時出現以下錯誤。我嘗試上傳JPG/PNG,但都不起作用。這似乎是我得到驗證錯誤..任何幫助將是真棒謝謝!問題:'圖片的內容不是他們報告的內容'

有沒有被他們所報道的

IINSTALL的file.exe,並添加

Paperclip.options[:command_path] = 'C:\Program Files (x86)\GnuWin32\bin' 

到devlopement.rb內容

我pic.rb

class Pic < ActiveRecord::Base belongs_to :user 

    has_attached_file :image, :styles => { :medium => "300x300>" } 
    validates_attachment_content_type :image, content_type: /\Aimage\/.*\z/ end 

我show.html.haml

= image_tag @pic.image.url 
%h1= @pic.title 
%p= @pic.description 
%p 
Pic by 
= @pic.user.try(:email) 

%br 

= link_to "Back", root_path 
= link_to "Edit", edit_pic_path 
= link_to "Delete", pic_path, method: :delete, data: { confirm: "Are you sure?" } 

回答

0

Probléme解決更新寶石回形針從4.2.0到5.0.0 和運行bundle安裝