Question: I tried to use aws-sdk + Paperclip gems with Ruby On Rails to use DigitalOcean Spaces to upload files

The problem i have is the result of configuration, i get "{name\_buncket}.s3.nyc3.amazonaws.com" instead of "{name\_buncket}.s3.nyc3.digitaloceanspaces.com", that last is the correct result to acces to DigitalOcean Spaces

The aws-sdk gem is exclusive for Amazon Services?, if that is the case, exist another gems similary to aws-sdk to use?

That is the configuration i use:

```
config.paperclip_defaults = {
    storage: :s3,
    url: '.....',
    s3_region: 'nyc3',
    s3_credentials: {
    bucket: '......',
    access_key_id: "......",
    secret_access_key: "........",
    s3_host_name: 'nyc3.digitaloceanspaces.com'
  }
}

```

Answer: 
In addition to setting `s3_host_name`, you'll also need to configure the `endpoint` used by the AWS SDK. Paperclip does not expose this directly, but it can be set through `s3_options` I am able to successfully use Paperclip with Spaces with the following config, where the env variable `S3_HOST_NAME` is set to `nyc3.digitaloceanspaces.com`:

```
  config.paperclip_defaults = {
    storage: :s3,
    bucket: ENV["S3_BUCKET"],
    s3_credentials: {
      access_key_id: ENV["S3_ACCESS_KEY_ID"],
      secret_access_key: ENV["S3_SECRET_ACCESS_KEY"]
    },
    s3_host_name: ENV["S3_HOST_NAME"],
    s3_host_alias: ENV["S3_HOST_ALIAS"],
    s3_region: ENV["S3_REGION"],
    s3_protocol: :https,
    s3_options: {
      endpoint: "https://" + ENV["S3_HOST_NAME"],
    },
    url: ":s3_alias_url",
    path: "/assets/:class/:attachment/:style/:filename",
  }

```
I think you're out of luck at the moment, although not for the hostname problem you're currently having.

The `s3_host_name` key should be outside of your `s3_credentials` block. If you change your configuration to this:

```
config.paperclip_defaults = {
  storage: :s3,
  url: '.....',
  s3_region: 'nyc3',
  s3_credentials: {
    bucket: '......',
    access_key_id: "......",
    secret_access_key: "........"
  },
  s3_host_name: 'nyc3.digitaloceanspaces.com'
}

```

you should fix your hostname problem.

However, **at the moment** this is just going to lead you to another problem: Paperclip/aws-sdk authentication isn't currently working with DigitalOcean Spaces - see [this issue on GitHub](https://github.com/thoughtbot/paperclip/issues/2487).