使用回形针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?" }
Probléme解决将宝石回形针从4.2.0升级到5.0.0的问题并运行捆绑安装