diff --git a/activesupport/lib/active_support/core_ext/kernel/reporting.rb b/activesupport/lib/active_support/core_ext/kernel/reporting.rb index 79d3303b41..36ab836457 100644 --- a/activesupport/lib/active_support/core_ext/kernel/reporting.rb +++ b/activesupport/lib/active_support/core_ext/kernel/reporting.rb @@ -91,6 +91,7 @@ module Kernel stream_io.rewind return captured_stream.read ensure + captured_stream.close captured_stream.unlink stream_io.reopen(origin_stream) end