【解決】dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib Reason: image not found

## Macのストレージ(その他)を綺麗にしたらRailsの開発環境がイカれた

```
$ ruby -v

dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
  Referenced from: /Users/jun/.rbenv/versions/2.6.5/bin/ruby
  Reason: image not found
```

とりあえず[エラー文をググって出た記事](https://teratail.com/questions/128283)に従い下記を実行


```
$ brew install gmp

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
bibtexconv                          calabash                            game-music-emu                      gearman                             phpstan

==> Downloading https://homebrew.bintray.com/bottles/gmp-6.2.0.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/2e/2e6acd6e62d1b8ef0800061e113aea30a63f56b32b99c010234c0420fd6d3ecf?__gda__=exp=1583198933~hmac=2197a8c3433e6d7893936a88233b20a545
######################################################################## 100.0%
==> Pouring gmp-6.2.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/gmp/6.2.0: 20 files, 3.2MB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /usr/local/Cellar/jpeg/9c... (21 files, 733.4KB)
Removing: /usr/local/Cellar/webp/1.0.3... (39 files, 2.1MB)
Removing: /Users/jun/Library/Logs/Homebrew/libheif... (203B)
Removing: /Users/jun/Library/Logs/Homebrew/ilmbase... (64B)
Removing: /Users/jun/Library/Logs/Homebrew/shared-mime-info... (211B)
Removing: /Users/jun/Library/Logs/Homebrew/libde265... (64B)
Removing: /Users/jun/Library/Logs/Homebrew/openexr... (64B)
Removing: /Users/jun/Library/Logs/Homebrew/x265... (64B)
Removing: /Users/jun/Library/Logs/Homebrew/imagemagick... (64B)
Pruned 7736 symbolic links and 72 directories from /usr/local
MacBook-Pro-4:mannyou_assignment jun$ ruby -v
/Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
Traceback (most recent call last):
	14: from /Users/jun/.rbenv/versions/2.6.5/bin/gem:21:in `<main>'
	13: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/gem_runner.rb:44:in `run'
	12: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/gem_runner.rb:79:in `do_configuration'
	11: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/gem_runner.rb:79:in `new'
	10: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/config_file.rb:198:in `initialize'
	 9: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/config_file.rb:346:in `load_file'
	 8: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems.rb:701:in `load_yaml'
	 7: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 6: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 5: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/yaml.rb:4:in `<top (required)>'
	 4: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 3: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 2: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/psych.rb:14:in `<top (required)>'
	 1: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- 2.6/psych.so (LoadError)
	15: from /Users/jun/.rbenv/versions/2.6.5/bin/gem:21:in `<main>'
	14: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/gem_runner.rb:44:in `run'
	13: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/gem_runner.rb:79:in `do_configuration'
	12: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/gem_runner.rb:79:in `new'
	11: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/config_file.rb:198:in `initialize'
	10: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/config_file.rb:346:in `load_file'
	 9: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems.rb:701:in `load_yaml'
	 8: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 7: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 6: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/yaml.rb:4:in `<top (required)>'
	 5: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 4: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	 3: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/psych.rb:13:in `<top (required)>'
	 2: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/psych.rb:16:in `rescue in <top (required)>'
	 1: from /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/x86_64-darwin18/psych.bundle, 9): Library not loaded: /usr/local/opt/libyaml/lib/libyaml-0.2.dylib (LoadError)
  Referenced from: /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/x86_64-darwin18/psych.bundle
  Reason: image not found - /Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/x86_64-darwin18/psych.bundle
```

エラー文が変わった

```
/Users/jun/.rbenv/versions/2.6.5/lib/ruby/2.6.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
```

この部分をググると**libyaml**がないとのことだったので`libyaml`をインストール

```
$ brew install libyaml

==> Downloading https://homebrew.bintray.com/bottles/libyaml-0.2.2.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libyaml-0.2.2.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libyaml/0.2.2: 9 files, 311.3KB
```


```
$ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]
```

復活！！！


## Macのストレージ(その他)を綺麗にしたらRailsの開発環境がイカれた

Macのストレージ(その他)を綺麗にしたらRailsの開発環境がイカれた①
[ruby -vができない](https://qiita.com/___inon_/items/aaed570712bfbae3116d)　　　　 ← ここ

Macのストレージ(その他)を綺麗にしたらRailsの開発環境がイカれた②
[bundle installでつまづく](https://qiita.com/___inon_/items/c898c67f536f9d2d766c)

Macのストレージ(その他)を綺麗にしたらRailsの開発環境がイカれた②
[rails db:createができない](https://qiita.com/___inon_/items/1ad3e2594dc0d35b9568)