Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/57.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
Ruby on rails 为未指定的终结点创建直接s3_Ruby On Rails_Ruby On Rails 3_Amazon S3_Ckeditor - Fatal编程技术网

Ruby on rails 为未指定的终结点创建直接s3

Ruby on rails 为未指定的终结点创建直接s3,ruby-on-rails,ruby-on-rails-3,amazon-s3,ckeditor,Ruby On Rails,Ruby On Rails 3,Amazon S3,Ckeditor,我正在试验s3,但我遇到了权限问题(我想) 输出: AWS::S3::PermanentRedirect in CkeditorController#create The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. 我正在使用ckeditor。我的Ckeditor::P

我正在试验s3,但我遇到了权限问题(我想)

输出:

 AWS::S3::PermanentRedirect in CkeditorController#create

The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
我正在使用ckeditor。我的Ckeditor::Picture类包括以下内容:

  has_attached_file :data,
  :s3_credentials => "#{Rails.root}/config/s3.yml",
  :storage => :s3,
  :path => ":attachment/:id/:style.:extension"

  validates_attachment_size :data, :less_than=>2.megabytes
在s3.yml中,我得到了:

access_key_id: "key"
secret_access_key: "key"
bucket: "name"
AWS_CALLING_FORMAT: SUBDOMAIN

我错过了什么?提前谢谢

我想你的桶不在美国标准区。您是否尝试将“AWS\u调用\u格式:子域”添加到.yml文件中?然后,请求应指向与您的存储桶区域对应的端点。

使用
回形针
3.1.4版,只需将
s3\u主机名
键添加到我的
s3.yml
文件:

development:
  bucket: 'bucket.name'
  access_key_id: 'xxx'
  secret_access_key: 'xxx'
  s3_host_name: 's3-eu-west-1.amazonaws.com'

我们可以像下面的代码一样使用默认端点

s3_credentials: {
     access_key_id: AWS_CONFIG['access_key_id'],
     secret_access_key: AWS_CONFIG['secret_access_key'],
     bucket: AWS_CONFIG['bucket'],
},
s3_host_name: 's3.amazonaws.com',
s3_endpoint: 's3.amazonaws.com',
storage: :s3,
s3_headers:     { "Cache-Control" => "max-age=31557600" },
s3_protocol:    "https",
bucket:         AWS_CONFIG['bucket'],
:url =>':s3_domain_url',
:path => '/:class/:attachment/:id_partition/:style/:filename',
default_url:   "/:class/:attachment/:id/:style/:basename.:extension",
default_style: "medium"

谢谢你的回答。我的桶在欧洲是的。我试图创造一个美国桶&它工作完美无瑕。然而,我试图把你的aws_调用_格式I,但仍然没有工作。我更新了我的s3.yml,你可以在我更新的问题中看到。是这样的吗?我想你需要用合适的子域来替换子域,例如:亚太地区:AWS_CALLING_格式:s3-website-ap-southeast-1,但它仍然不适用于我!