rails + carrierwave + fog + S3 socket error

2019-02-08 06:34发布

I'm having this problem trying to use S3 services with fog and the Jquery File Upload (https://github.com/blueimp/jQuery-File-Upload)

The error

Excon::Errors::SocketError (getaddrinfo: nodename nor servname provided, or not known (SocketError)): 

This occur when i try to call "save" method in the controller. I'm setting carrierwave as follow:

config/initializers/carrierwave.rb

CarrierWave.configure do |config|
  config.fog_credentials = {
    :provider               => 'AWS', 
    :aws_access_key_id      => 'access_key_here', 
    :aws_secret_access_key  => 'secret_key_here', 
    :region                 => 'eu-east-1'
  }
  config.fog_directory  = 'folder_name_here'
  config.fog_public     = false 
  config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
  config.storage = :fog
end

and my uploader just the "config.storage :fog" and the "store_dir" Now, I have created my bucket already.

Am i missing some configuration? It doesn't even work on my dev environment.

Please any help. Thanks in advance.

1条回答
劫难
2楼-- · 2019-02-08 07:26

The region name is wrong. It should be 'us-east-1'

查看更多
登录 后发表回答