diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 9baee34b2d..7dea86c3dd 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -764,9 +764,9 @@ module Gem # Safely read a file in binary mode on all platforms. def self.read_binary(path) - File.open path, binary_mode do |f| + File.open path, binary_mode do |f| f.flock(File::LOCK_EX) - f.read + f.read end end