开发者

CarrierWave S3 Permission denied error trying to read from the tmp

开发者 https://www.devze.com 2023-02-10 08:45 出处:网络
Using CarrierWave and Amazon S3. CarrierWave config: CarrierWave.configure do |config| config.ensure_multipart_form = false

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开发者_Go百科/my_file.txt.

What's wrong?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消