Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon s3 神龛图像上传器安装不正确_Amazon S3_Ruby On Rails 5_Shrine - Fatal编程技术网

Amazon s3 神龛图像上传器安装不正确

Amazon s3 神龛图像上传器安装不正确,amazon-s3,ruby-on-rails-5,shrine,Amazon S3,Ruby On Rails 5,Shrine,我正试图学习本教程,在加载本地服务器时,它会抛出以下错误: routing/mapper.rb:613:in `mount': A rack application must be specified (ArgumentError) 以下是我的路线: Rails.application.routes.draw do root to: "photos#index" resources :photos mount ImageUploader::UploadEndpoint, at: "/

我正试图学习本教程,在加载本地服务器时,它会抛出以下错误:

 routing/mapper.rb:613:in `mount': A rack application must be specified (ArgumentError)
以下是我的路线:

Rails.application.routes.draw do
 root to: "photos#index"
 resources :photos

 mount ImageUploader::UploadEndpoint, at: "/images/upload"
end
如果有人需要它,我的hire.rb初始化器

require "shrine/storage/s3"

 s3_options = {
  access_key_id: "MY_ACCESS_KEY",
  secret_access_key: "MY_SECRET_KEY",
  region: "S3_REGION",
  bucket: "S3_BUCKET",
}

Shrine.storages = {
  cache: Shrine::Storage::S3.new(prefix: "cache", **s3_options),
  store: Shrine::Storage::S3.new(prefix: "store", **s3_options),
}

Shrine.plugin :activerecord
Shrine.plugin :upload_endpoint
Shrine.plugin :presign_endpoint
Shrine.plugin :restore_cached_data

任何和所有的帮助将不胜感激

Shire::UploadEndpoint类是一个带有旧的
direct_upload
插件的框架应用程序。使用
upload\u endpoint
插件,您现在可以调用
sicle.upload\u endpoint
方法为所选存储创建机架应用程序:

mount ImageUploader.upload_endpoint(:cache), at: "/images/upload"