121925
diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb
121925
index 9ed5b2c9ed..13eb25bd26 100644
121925
--- a/lib/rubygems/package.rb
121925
+++ b/lib/rubygems/package.rb
121925
@@ -371,6 +371,8 @@ EOM
121925
       File.respond_to? :realpath
121925
 
121925
     destination = File.join destination_dir, filename
121925
+    destination = File.realpath destination if
121925
+      File.respond_to? :realpath
121925
     destination = File.expand_path destination
121925
 
121925
     raise Gem::Package::PathError.new(destination, destination_dir) unless
121925
-- 
121925
2.20.1
121925