From 29c54b5e03f2d96f1387f77f34f77b62caddbef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Fri, 28 Aug 2020 10:16:21 +0200 Subject: [PATCH] Add missing fileutils require On my system, the error was being hidden by the presence of a YARD rubygems plugin that was providing the require and making things work. --- lib/rubygems/source.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rubygems/source.rb b/lib/rubygems/source.rb index bed9c51346..ef232ff35d 100644 --- a/lib/rubygems/source.rb +++ b/lib/rubygems/source.rb @@ -179,7 +179,10 @@ class Gem::Source local_file = File.join(cache_dir, file_name) retried = false - FileUtils.mkdir_p cache_dir if update_cache? + if update_cache? + require "fileutils" + FileUtils.mkdir_p cache_dir + end spec_dump = fetcher.cache_update_path spec_path, local_file, update_cache?