Rails 4: Heroku + Paperclip + s3 not working in production

前端 未结 2 953
深忆病人
深忆病人 2021-01-16 23:52

so im following this tutorial: https://devcenter.heroku.com/articles/paperclip-s3

I manage to deploy it to Heroku and App is working in the development. The app is r

2条回答
  •  情书的邮戳
    2021-01-17 00:00

    Add region and s3_host_name.

    config.paperclip_defaults = {
        storage: :s3,
        s3_credentials: {
          bucket: ENV["S3_BUCKET_NAME"],
          access_key_id: ENV["AWS_ACCESS_KEY_ID"],
          secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"],
          s3_region: ENV["S3_REGION"],
          s3_host_name: ENV["S3_HOST_NAME"]
        }
    

    S3_REGION="eu-central-1" S3_HOST_NAME="s3.eu-central-1.amazonaws.com"

    Regions and endpoints: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

    Using gem "aws-sdk", "~> 2.0"

提交回复
热议问题