配置aws后出错

问题描述 投票:0回答:1

这是我的错误消息:

在Admin :: ProductsController#update中的Excon :: Error :: Socket

破管(Errno :: EPIPE)

提取的来源(第386行):

  def write_nonblock(s, exception: true)
    flush
    syswrite_nonblock(s, exception: exception)
  end

我的初始化程序看起来像这样......

CarrierWave.configure do |config|
  config.fog_provider = 'fog/aws'                        
  config.fog_credentials = {
    provider:              'AWS',                        
    aws_access_key_id:     'X',                       
    aws_secret_access_key: 'X',                       
    region:                'eu-west-2',                 
    host:                  's3.eu-west-2.amazonaws.com'
  config.fog_directory  = 'xxxx'                         
end
ruby-on-rails amazon-web-services amazon-s3
1个回答
1
投票

没有理想的配置

你可以这样跟着

CarrierWave.configure do |config|
   config.fog_credentials = {
     :provider              => 'AWS',
     :aws_access_key_id     => 'aws_access_key_id',
     :aws_secret_access_key => 'aws_secret_access_key ',
     :region                => 'eu-west-2'
   } #=> end credentials
   config.fog_directory    = 'bucket-name'
end

有关更多说明,您可以关注this

我认为会有所帮助

© www.soinside.com 2019 - 2024. All rights reserved.