The folllowing error appears in my logs when i try to upload a file with carrierwave.
Errno::EPERM (Operation not permitted @ chmod_internal - /home/daniel/public/my_app/public/uploads): app/controllers/admin/file_uploads_controller.rb:21:in `manual'
This happens when i execute the following action:
def manual
Product.where(distributor: 'handmatig').map{|c| [c.update(deleted: true)]}
@file_upload = FileUpload.new(file_upload_params)
@file_upload.name = "united"
if @file_upload.save
flash['notice'] = "Uw bestand is geupload."
redirect_to :back
end
end
Line 21 is the line that holds if @file_upload.save
.
I tried using sudo chmod -R 777 public/uploads/
, but it doesnt appear to help.
What is causing this error and how do i get passed it? I wish i was more familiar with permissions.