简体   繁体   English

权限被拒绝Paperclip和s3错误

[英]Permission denied Paperclip and s3 error

I have a rails 4 app deployed on heroku. 我在heroku上部署了一个rails 4应用程序。 I'm using Amazon s3 bucket to host images (using paperclip gem), but when I try to upload an image to my articles controller i get this error: 我正在使用亚马逊s3存储桶来托管图像(使用paperclip gem),但是当我尝试将图像上传到我的文章控制器时,我收到此错误:

Permission denied @ dir_s_mkdir - /articles

I have gone through the steps listed here . 我已经完成了这里列出的步骤。 As i understand this could be a folder permission issue, but not really to sure how to tackle the issue. 据我所知,这可能是一个文件夹权限问题,但不是真的确定如何解决这个问题。

Try putting the following code in your /config/environments/production.rb file and update ENV secret key names accordingly. 尝试将以下代码放在/config/environments/production.rb文件中,并相应地更新ENV密钥名称。 The host name is dependent on your region, us-west-1 , eu-west-1 , etc. 主机名取决于您所在的地区, us-west-1eu-west-1等。

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_host_name => 's3-us-west-1.amazonaws.com'
    }
}

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

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