4

Using CarrierWave and Amazon S3. CarrierWave config:

CarrierWave.configure do |config|
      config.ensure_multipart_form = false

      config.permissions = 0777      
      config.s3_access_key_id = 'secret_access_key_id'
      config.s3_secret_access_key = 'secret_access_key'
      config.s3_bucket = 'backet_name'
 end

I get a permission denied error trying to read from the tmp directory when uploading to s3.

Errno::EACCES

Permission denied - D:/MyDirectory/public/uploads/tmp/20110211-1021-3252-6545/my_file.txt.

What's wrong?

iwasrobbed
  • 46,496
  • 21
  • 150
  • 195
Oksana
  • 13,442
  • 10
  • 53
  • 89

1 Answers1

9

I had this issue using Heroku, and solved it by changing the cache directory in the uploader.

def cache_dir
  "#{Rails.root}/tmp/uploads"
end
DrewBowman
  • 100
  • 5
  • Exactly. You can't access the public directory like he was trying to do `D:/MyDirectory/public/uploads...` – iwasrobbed May 27 '11 at 16:38
  • For an explanation, and some links to examples, see [this answer](http://stackoverflow.com/a/9877639/664833). – user664833 Mar 26 '12 at 18:33