我正在尝试使用 Shrine 将图像上传到谷歌驱动器。我按照这个宝石的说明 https://github.com/verynear/shrine-google_drive_storage
我将这些宝石添加到我的项目中
gem 'shrine'
gem 'shrine-google_drive_storage'
这是我的 config/shrine.rb
require "shrine"
require "shrine/storage/google_drive_storage"
Shrine.storages = {
cache: Shrine::Storage::GoogleDriveStorage.new(prefix: "cache"),
store: Shrine::Storage::GoogleDriveStorage.new(prefix: "store"),
}
Shrine::Storage::GoogleDriveStorage.new(
prefix: "store",
google_drive_client_secret_path: "#{Rails.root}/config/client_secret.json",
drive_public_folder_id: '0Bz_kkknizZmZRXZzeXdua1FNUXc',
google_drive_options: {
path: proc { |style| "#{id}_#{photo.original_filename}_#{style}" },
},
)
但是当我尝试上传图片时,我收到此错误消息
NameError (undefined local variable or method `content_type' for #<Shrine::Storage::GoogleDriveStorage:0x00000004009868>):
有人知道我在哪里犯错了吗?