我在谷歌云上部署我的应用程序时遇到问题,我收到此错误
has contents that are not what they are reported to be
本地运行正常!我已经尝试使用 command_path。所以我真的不知道我接下来要做什么......
这是我的模型
has_mongoid_attached_file :image,
:styles => { :large => "380x380!" , :medium => "240x240", :small => "120x120!" },
:storage => :fog,
:fog_public => true,
:fog_directory => 'XXXX',
:path => "images/:id/:style/:basename.:extension",
:fog_credentials => { :provider => 'Google',
:google_storage_access_key_id => 'XXXXX',
:google_storage_secret_access_key => 'XXXXX'}
validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png", "image/gif"]
感谢您的努力。希望大家帮帮我
最佳答案
好的,我找到了一个结果。我刚刚创建了一个 initializers/paperclip.rb
文件
require 'paperclip/media_type_spoof_detector'
module Paperclip
class MediaTypeSpoofDetector
def spoofed?
false
end
end
end
现在它非常适合我。
如果您在使用 Rails 的 App Engine 上遇到 ImageMagick 问题,请参阅此 link
关于ruby-on-rails - 生产中的回形针验证问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36240872/