carrierwaveuploader / carrierwave

Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
https://github.com/carrierwaveuploader/carrierwave
8.78k stars 1.66k forks source link

EACCES - Permission denied @ rb_files_s_rename on Windows #2601

Open Tjorbenn opened 2 years ago

Tjorbenn commented 2 years ago

image

When I try to upload a file using carrierwave I get an EACCES exception. I think it has something to do with files not being closed by carrierwave before moving/renaming.

Carrierwave Version: 2.2.2

tobmatth commented 2 years ago

https://stackoverflow.com/questions/62995807/errnoeacces-upon-deleting-a-file-on-windows-10

Might be sufficient to add a file.close if file.respond_to?(:close) to copy! and move!