“missing required :bucket option” for Paperclip/S3

前端 未结 3 1178
深忆病人
深忆病人 2021-02-05 22:40

In my Rails app I\'m letting users upload an image when they create a \"release\", and it should upload directly to S3. I\'m getting the following error in both development and

3条回答
  •  渐次进展
    2021-02-05 23:11

    In my case it was that I was using foreman (Heroku) which uses an .env file to store environment variables. So, when I did rake db:migrate it couldn't find the ENV['AWS_ACCESS_KEY_ID']

    What I did to run my migration was I temporarily added my AWS credentials directlñy into Carrierwave config block and then removed them after...

    This is not a permanent solution because next time you migrate it will say the same thing...

    For the permanent solution see: Use environment variables in Rake task

    which says use: foreman run rake some_task this way all variables defined in .env are loaded for the rake task too

提交回复
热议问题