core: tolerate errors in gemrc
This commit is contained in:
parent
d368b3cf62
commit
a571222431
|
@ -123,7 +123,15 @@ module Vagrant
|
||||||
|
|
||||||
# Set a custom configuration to avoid loading ~/.gemrc loads and
|
# Set a custom configuration to avoid loading ~/.gemrc loads and
|
||||||
# /etc/gemrc and so on.
|
# /etc/gemrc and so on.
|
||||||
old_config = Gem.configuration
|
old_config = nil
|
||||||
|
begin
|
||||||
|
old_config = Gem.configuration
|
||||||
|
rescue Psych::SyntaxError
|
||||||
|
# Just ignore this. This means that the ".gemrc" file has
|
||||||
|
# an invalid syntax and can't be loaded. We don't care, because
|
||||||
|
# when we set Gem.configuration to nil later, it'll force a reload
|
||||||
|
# if it is needed.
|
||||||
|
end
|
||||||
Gem.configuration = NilGemConfig.new
|
Gem.configuration = NilGemConfig.new
|
||||||
|
|
||||||
# Use a silent UI so that we have no output
|
# Use a silent UI so that we have no output
|
||||||
|
|
Loading…
Reference in New Issue