1

I've deployed a Rails 5 app to my VPS (not a Heroku instance).

Instead of the homepage, I'm getting an error message:

We're sorry, but something went wrong

When I look in the production.log file, I see this error:

missing required :bucket option

I'm using Paperclip (version 5.0.0) and this is the configuration:

config/environments/production.rb
config.paperclip_defaults = {
storage: :s3,
s3_region: ENV['AWS_REGION'],
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-#{ENV['AWS_REGION']}.amazonaws.com",
}

}

For my environment variables I'm using the Figaro gem.

For test purposes, I also configured to use S3 storage in development, but I'm getting the same error:

missing required :bucket option

Does anyone has experience with this error? How can I fix this?

thanks for your help,

Anthony

Mahesh Khond
  • 1,297
  • 1
  • 14
  • 31
Toontje
  • 1,415
  • 4
  • 25
  • 43
  • Figaro is for local environment variables. Are those env variables on your server? You need to check. On heroku it would be `heroku config` ...you need to check the equivalent on your VPS. – toddmetheny Nov 16 '16 at 13:54
  • I was able to fix it with this configuration settings in production.rb: config.paperclip_defaults = { storage: :s3, bucket: Rails.application.secrets.S3_BUCKET, s3_region: Rails.application.secrets.S3_REGION, s3_credentials: { access_key_id: Rails.application.secrets.AWS_ACCESS_KEY_ID, secret_access_key: Rails.application.secrets.AWS_SECRET_ACCESS_KEY, s3_host_name: "s3-xxx-.amazonaws.com", } } – Toontje Nov 16 '16 at 14:41
  • Possible duplicate of ["missing required :bucket option" for Paperclip/S3](http://stackoverflow.com/questions/17863938/missing-required-bucket-option-for-paperclip-s3) – New Alexandria Apr 28 '17 at 03:14

0 Answers0