Ruby on rails Rails文件在生产时上载
我正在尝试使用carrierwave在本地服务器上上载图像,但没有错误。 但当我试图在我的生产服务器上上传相同的图像时,我遇到了验证错误(文件类型和空字段表单)。 我还检查规则,在我的公开/上传中,我设置了777 可能是什么Ruby on rails Rails文件在生产时上载,ruby-on-rails,ruby,ruby-on-rails-3,ruby-on-rails-4,carrierwave,Ruby On Rails,Ruby,Ruby On Rails 3,Ruby On Rails 4,Carrierwave,我正在尝试使用carrierwave在本地服务器上上载图像,但没有错误。 但当我试图在我的生产服务器上上传相同的图像时,我遇到了验证错误(文件类型和空字段表单)。 我还检查规则,在我的公开/上传中,我设置了777 可能是什么 class ApplicationUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick storage :file def store_dir "uploa
class ApplicationUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
storage :file
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def extension_white_list
%w(jpg jpeg gif png)
end
def filename
if original_filename
@name ||= Digest::MD5.hexdigest(File.dirname(current_path))
"#{@name}.#{file.extension}"
end
end
def auto_orient
manipulate!(&:auto_orient)
end
version :admin_thumb do
process :auto_orient
process resize_to_fit: [100, 100]
end
version :category_thumb do
process :auto_orient
process resize_to_fill: [327, 258]
end
version :list_thumb do
process :auto_orient
process resize_to_fill: [150, 115]
end
end
class ApplicationUploader
my carrierwave uploader:我已经用yum安装ImageMagic修复了它您的生产日志应该会告诉您一些事情。是的,我也尝试过检查日志,但没有错误。。。