我写了一个带有文件上传功能的rails应用程序。我使用mongoDB - mongoid和CarrieWave。
../模型/ data_file.rb:
class DataFile
include Mongoid::Document
field :title, type: String
mount_uploader :file, FileUploader
end
../上传/ file_uploader.rb:
class FileUploader < CarrierWave::Uploader::Base
storage :grid_fs
def store_dir
uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
当我启动我的根页面时,我收到此错误:
undefined method `validate_integrity' for FileUploader:Module
也许原因在于mongoDB?
感谢。