From 39d804b151e5958be5ef140920cbee2f2cd1c78c Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Fri, 25 May 2018 17:27:18 +0900 Subject: [PATCH] Reload remote file the cacheds file is already removed --- config/initializers/carrierwave_monkey_patch.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/initializers/carrierwave_monkey_patch.rb b/config/initializers/carrierwave_monkey_patch.rb index dd2c656b171..bfd0f1c3d36 100644 --- a/config/initializers/carrierwave_monkey_patch.rb +++ b/config/initializers/carrierwave_monkey_patch.rb @@ -15,6 +15,9 @@ module CarrierWave begin file_body = ::File.open(file_body.path) if file_body.closed? # Reopen if it's closed file_body.read + rescue Errno::ENOENT + @file = nil # rubocop:disable Gitlab/ModuleWithInstanceVariables + file.body ensure file_body.close end