简体   繁体   English

rails + carrierwave + fog + S3套接字错误

[英]rails + carrierwave + fog + S3 socket error

I'm having this problem trying to use S3 services with fog and the Jquery File Upload (https://github.com/blueimp/jQuery-File-Upload) 我有这个问题试图使用雾服务的S3服务和Jquery文件上传(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. 当我尝试在控制器中调用“save”方法时会发生这种情况。 I'm setting carrierwave as follow: 我将载波设置如下:

config/initializers/carrierwave.rb 配置/初始化/ 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. 和我的上传者只是“config.storage:fog”和“store_dir”现在,我已经创建了我的桶。

Am i missing some configuration? 我错过了一些配置吗? It doesn't even work on my dev environment. 它甚至不适用于我的开发环境。

Please any help. 请帮忙。 Thanks in advance. 提前致谢。

The region name is wrong. 区域名称错误。 It should be 'us-east-1' 它应该是'us-east-1'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM