问题
I've got Heroku working fine with paperclip, but I'm getting this error when I move the app over to a linux box, the logs show that imagemagick processing finishes and then it fails on upload:
ArgumentError (missing required :bucket option):
My application.yml includes:
S3_BUCKET_NAME: "bucket"
AWS_ACCESS_KEY_ID: "key"
AWS_SECRET_ACCESS_KEY: "secret"
I've doubled-checked that all of that info is correct. production.rb
includes:
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']
}
}
I've reset the server and redeployed to reload the initializers. Is there a way to see ENV variables in rails c on a linux box to see if they're set correctly? I know on heroku you can just do heroku config
. I suspect this may be due to my lack of understanding of rails ENV vars
回答1:
I was missing gem 'figaro'
in my production env, so none of the ENV variables were being set.
来源:https://stackoverflow.com/questions/23108589/rails-paperclip-missing-required-bucket-option