vagrant: Resolve crash by replacing gem symlinks with directories

This workaround was discovered by painstakingly resolving the
differences between a working installation and a non-working
installation until a minimal change was found.  I have no idea why it
works.

Fixes #76629.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2019-12-31 20:04:50 -08:00
parent b0bbacb521
commit 5ddafad13e

View File

@ -25,6 +25,17 @@ let
inherit version;
};
} // lib.optionalAttrs withLibvirt (import ./gemset_libvirt.nix));
# This replaces the gem symlinks with directories, resolving this
# error when running vagrant (I have no idea why):
# /nix/store/p4hrycs0zaa9x0gsqylbk577ppnryixr-vagrant-2.2.6/lib/ruby/gems/2.6.0/gems/i18n-1.1.1/lib/i18n/config.rb:6:in `<module:I18n>': uninitialized constant I18n::Config (NameError)
postBuild = ''
for gem in "$out"/lib/ruby/gems/*/gems/*; do
cp -a "$gem/" "$gem.new"
rm "$gem"
mv "$gem.new" "$gem"
done
'';
};
in buildRubyGem rec {