How to solve "Access Denied" with Heroku + Paperclip + S3 + ROR
The instructions provided by Heroku on how to get Rails 4 + Heroku + Paperclip gem + Amazon S3 image storage did not work for me.
- ruby
Originally published at rexstjohn.com on August 22, 2014. Recovered from the Internet Archive.
The instructions provided by Heroku on how to get Rails 4 + Heroku + Paperclip gem + Amazon S3 image storage did not work for me. These instructions did: <http://jaysonlane.net/tech-blog/2012/04/rails-heroku-image-attachments-using-paperclip-and-s3/>.
The one additional thing to make sure of, once you have created an S3 “bucket” for your images (and followed the appropriate naming conventions stated by Heroku) is that you must set an IAM policy.
This is different than an S3 bucket policy and resulted in a lot of confusion on my part as to why I kept getting Access Denied errors on Heroku when trying to upload paperclip images.
To set your IAM policy, you need to navigate over to: <https://console.aws.amazon.com/iam/home#users>. Select your user and then click “Attach User Policy” -> “Administrator Access.” Once you have added Admin access to your user, your access denied errors should go away.