From c2c51cab328679ed1b9e4fb49c74ee1b0e652ee0 Mon Sep 17 00:00:00 2001 From: Aleksei Gusev Date: Wed, 24 Jan 2018 12:45:06 +0300 Subject: [PATCH] Add Errno::EEXIST as possible exception that happens on linking --- lib/paperclip/io_adapters/abstract_adapter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paperclip/io_adapters/abstract_adapter.rb b/lib/paperclip/io_adapters/abstract_adapter.rb index 5378bba76..17f41ed56 100644 --- a/lib/paperclip/io_adapters/abstract_adapter.rb +++ b/lib/paperclip/io_adapters/abstract_adapter.rb @@ -61,7 +61,7 @@ def link_or_copy_file(src, dest) FileUtils.ln(src, dest, force: true) # overwrite existing @destination.close @destination.open.binmode - rescue Errno::EXDEV, Errno::EPERM, Errno::ENOENT => e + rescue Errno::EXDEV, Errno::EPERM, Errno::ENOENT, Errno::EEXIST => e Paperclip.log("Link failed with #{e.message}; copying link #{src} to #{dest}") FileUtils.cp(src, dest) end