So today I decided to explore how to use Paperclip + Amazon S3 on Heroku for photo upload process. The process is quite straight forward.
But, I got stucked after I deployed the Rails app into my Heroku account. I got this error:
We're sorry, but something went wrong
It took me hours to find out what's wrong. Finally, I found the solution.
Here's what I've done:
- Create an IAM user here. I named it
heroku
- Copy the
bucket name
,access key id
andsecret access key
and put them insideconfig/environments/production.rb
file (I'm using Figaro gem too) - Add a policy called
AmazonS3FullAccess
for the user in step #1
Done!