psych が原因で bundle install がこける

なぜか半年に一回くらい死ぬ。毎回すぐ直るのだが。



## 直し方

```
gem uninstall psych
bundle install
```




## エラーログ

```      
$ bundle install
                                                                                                                                                                                                    
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/versions.rb:5: warning: already initialized constant Psych::VERSION
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/versions.rb:5: warning: previous definition of VERSION was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych.bundle: warning: already initialized constant Psych::Parser::ANY
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych.bundle: warning: already initialized constant Psych::Parser::UTF8
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych.bundle: warning: already initialized constant Psych::Parser::UTF16LE
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych.bundle: warning: already initialized constant Psych::Parser::UTF16BE
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:7: warning: already initialized constant Psych::ClassLoader::BIG_DECIMAL
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:7: warning: previous definition of BIG_DECIMAL was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:8: warning: already initialized constant Psych::ClassLoader::COMPLEX
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:8: warning: previous definition of COMPLEX was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:9: warning: already initialized constant Psych::ClassLoader::DATE
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:9: warning: previous definition of DATE was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:10: warning: already initialized constant Psych::ClassLoader::DATE_TIME
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:10: warning: previous definition of DATE_TIME was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:11: warning: already initialized constant Psych::ClassLoader::EXCEPTION
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:11: warning: previous definition of EXCEPTION was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:12: warning: already initialized constant Psych::ClassLoader::OBJECT
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:12: warning: previous definition of OBJECT was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:13: warning: already initialized constant Psych::ClassLoader::PSYCH_OMAP
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:13: warning: previous definition of PSYCH_OMAP was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:14: warning: already initialized constant Psych::ClassLoader::PSYCH_SET
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:14: warning: previous definition of PSYCH_SET was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:15: warning: already initialized constant Psych::ClassLoader::RANGE
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:15: warning: previous definition of RANGE was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:16: warning: already initialized constant Psych::ClassLoader::RATIONAL
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:16: warning: previous definition of RATIONAL was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:17: warning: already initialized constant Psych::ClassLoader::REGEXP
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:17: warning: previous definition of REGEXP was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:18: warning: already initialized constant Psych::ClassLoader::STRUCT
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:18: warning: previous definition of STRUCT was here
/Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:19: warning: already initialized constant Psych::ClassLoader::SYMBOL
/Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/class_loader.rb:19: warning: previous definition of SYMBOL was here

/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/cli.rb:24:in `start'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/exe/bundle:49:in `block in <top (required)>'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/exe/bundle:37:in `<top (required)>'
  /Users/me/.rbenv/versions/2.7.2/bin/bundle:23:in `load'
  /Users/me/.rbenv/versions/2.7.2/bin/bundle:23:in `<main>'


## Backtrace

SyntaxError: (eval):2: syntax error, unexpected =>, expecting '}'
  load {"Date"=>Date, "DateTime"=>DateTime, "...
      ^~
(eval):2: dynamic constant assignment
  load {"Date"=>Date, "DateTime"=>DateTime, "Exce...
        ^~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...oad {"Date"=>Date, "DateTime"=>DateTime, "Exception"=>Except...
...                             ^~
(eval):2: dynamic constant assignment
...te"=>Date, "DateTime"=>DateTime, "Exception"=>Exception, "Ps...
...                       ^~~~~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...eTime"=>DateTime, "Exception"=>Exception, "Psych::Omap"=>Psy...
...                             ^~
(eval):2: dynamic constant assignment
...ateTime, "Exception"=>Exception, "Psych::Omap"=>Psych::Omap,...
...                      ^~~~~~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...on"=>Exception, "Psych::Omap"=>Psych::Omap, "Psych::Set"=>Ps...
...                             ^~
(eval):2: dynamic constant assignment
...ion, "Psych::Omap"=>Psych::Omap, "Psych::Set"=>Psych::Set, "...
...                    ^~~~~~~~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...p"=>Psych::Omap, "Psych::Set"=>Psych::Set, "Range"=>Range, "...
...                             ^~
(eval):2: dynamic constant assignment
...:Omap, "Psych::Set"=>Psych::Set, "Range"=>Range, "Rational"=...
...                     ^~~~~~~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...ch::Set"=>Psych::Set, "Range"=>Range, "Rational"=>Rational, ...
...                             ^~
(eval):2: dynamic constant assignment
...et"=>Psych::Set, "Range"=>Range, "Rational"=>Rational, "Stru...
...                          ^~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...t, "Range"=>Range, "Rational"=>Rational, "Struct"=>Struct, "...
...                             ^~
(eval):2: dynamic constant assignment
...e"=>Range, "Rational"=>Rational, "Struct"=>Struct, "Regexp"=...
...                       ^~~~~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...Rational"=>Rational, "Struct"=>Struct, "Regexp"=>Regexp, "Sy...
...                             ^~
(eval):2: dynamic constant assignment
...al"=>Rational, "Struct"=>Struct, "Regexp"=>Regexp, "Symbol"=...
...                         ^~~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...l, "Struct"=>Struct, "Regexp"=>Regexp, "Symbol"=>Symbol, "Ob...
...                             ^~
(eval):2: dynamic constant assignment
...ruct"=>Struct, "Regexp"=>Regexp, "Symbol"=>Symbol, "Object"=...
...                         ^~~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...t, "Regexp"=>Regexp, "Symbol"=>Symbol, "Object"=>Object, "Co...
...                             ^~
(eval):2: dynamic constant assignment
...gexp"=>Regexp, "Symbol"=>Symbol, "Object"=>Object, "Complex"...
...                         ^~~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
...p, "Symbol"=>Symbol, "Object"=>Object, "Complex"=>Complex}
...                             ^~
(eval):2: dynamic constant assignment
...mbol"=>Symbol, "Object"=>Object, "Complex"=>Complex}
...                         ^~~~~~
(eval):2: syntax error, unexpected =>, expecting '.' or &. or :: or '['
..., "Object"=>Object, "Complex"=>Complex}
...                             ^~

  /Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:38:in `class_eval'
  /Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:38:in `block in <class:ClassLoader>'
  /Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:36:in `each'
  /Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:36:in `<class:ClassLoader>'
  /Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:6:in `<module:Psych>'
  /Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/class_loader.rb:5:in `<top (required)>'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
  /Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/nodes/node.rb:3:in `<top (required)>'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
  /Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych/nodes.rb:2:in `<top (required)>'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
  /Users/me/.rbenv/gems/2.7.0/gems/psych-4.0.1/lib/psych.rb:15:in `<top (required)>'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems.rb:698:in `load_yaml'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/config_file.rb:332:in `load_file'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/config_file.rb:182:in `initialize'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems.rb:343:in `new'
  /Users/me/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems.rb:343:in `configuration'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/rubygems_integration.rb:115:in `configuration'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/fetcher.rb:247:in `connection'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/fetcher.rb:89:in `initialize'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/source/rubygems.rb:281:in `new'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/source/rubygems.rb:281:in `block in fetchers'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/source/rubygems.rb:279:in `map'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/source/rubygems.rb:279:in `fetchers'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/source/rubygems.rb:413:in `api_fetchers'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/source/rubygems.rb:320:in `dependency_api_available?'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/source/rubygems.rb:287:in `double_check_for'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/spec_set.rb:87:in `block in materialize'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/spec_set.rb:82:in `each'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/spec_set.rb:82:in `materialize'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/definition.rb:183:in `specs'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/installer.rb:254:in `ensure_specs_are_compatible!'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/installer.rb:84:in `block in run'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/process_lock.rb:12:in `block in lock'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/process_lock.rb:9:in `open'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/process_lock.rb:9:in `lock'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/installer.rb:72:in `run'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/installer.rb:24:in `install'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/cli/install.rb:64:in `run'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/cli.rb:259:in `block in install'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/settings.rb:133:in `temporary'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/cli.rb:258:in `install'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/cli.rb:30:in `dispatch'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/cli.rb:24:in `start'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/exe/bundle:49:in `block in <top (required)>'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
  /Users/me/.rbenv/gems/2.7.0/gems/bundler-2.2.18/exe/bundle:37:in `<top (required)>'
  /Users/me/.rbenv/versions/2.7.2/bin/bundle:23:in `load'
  /Users/me/.rbenv/versions/2.7.2/bin/bundle:23:in `<main>'

```