0

I'm trying to get refinerycms to upload files to s3, using the fog gem.

I'd like to pull my S3 credentials from a file that is not in my git repo (e.g. s3.yml)

I found some old references to doing this using the aws-s3 gem, but not fog.

Thanks in advance for any help!

rda3000
  • 1,410
  • 1
  • 18
  • 31

1 Answers1

1

I keep my config in a config file rather than a yml file. In config/s3_config.rb:

ENV['S3_KEY']     = 'MYS3KEY'
ENV['S3_SECRET']  = 'MYSECRETKEY'
ENV['S3_BUCKET']  = 'this-is-my-bucket'

When you run your rails app (this would be in development), the config file is automatically loaded, so those credentials will be referenced to the constants (ENV['S3_KEY']).

This would be different when you deploy your application. For instance Heroku, you would create those config vars.

Tonys
  • 3,349
  • 4
  • 24
  • 27