Search code examples
ruby-on-railsherokuamazon-web-servicescarrierwavefog

Resetting S3 bucket on Heroku to the default setting


I am trying to configure my app for uploading images with carrierwave/fog/AWS. I ran the following command in my terminal and need to reset it to the default setting. I've searched documentation but cannot find anything on this topic. Any ideas? The command I ran (that I'd like to take back) was

heroku config:set S3_BUCKET_NAME="simple-toy-#{Rails.env}"

In my carrier wave upload initializer I have the fog directory set as what's shown below :

config.fog_directory  = "simple-toy-#{Rails.env}"

Solution

  • heroku config:set just sets an environment variable on heroku.

    There is no default value for S3_BUCKET_NAME. So, if you have overwritten a previous value and want to get back to it, you will have to find from some other source what was the value and set it using heroku config:set

    If you want to remove current environmental variable (undo your command), you need to do

    heroku config:unset S3_BUCKET_NAME