Rails rails consoleやったらreadlineエラーが出た

# rails consoleでエラー
+ エラー内容

```ターミナル
$ rails c
Traceback (most recent call last):
	14: from bin/rails:4:in `<main>'
	13: from bin/rails:4:in `require'
	12: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<top (required)>'
	11: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command.rb:44:in `invoke'
	10: from /Users/groovy/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command.rb:70:in `find_by_namespace'
	 9: from /Users/groovy/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:79:in `lookup'
	 8: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:79:in `each'
	 7: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:80:in `block in lookup'
	 6: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:80:in `each'
	 5: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
	 4: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:84:in `require'
	 3: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands/console/console_command.rb:4:in `<top (required)>'
	 2: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands/console/console_command.rb:4:in `require'
	 1: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/irb/completion.rb:10:in `<top (required)>'
/Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/irb/completion.rb:10:in `require': dlopen(/Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
  Referenced from: /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle
  Reason: image not found - /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle
```
readlineが入ってないのかな？と思い、brew installしてみた。

```
$ brew install readline
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
frugal                                            geos                                              salt

Warning: readline 8.0.1 is already installed and up-to-date
To reinstall 8.0.1, run `brew reinstall readline`
```
rails cを叩いてみる。

```
$ rails c
Traceback (most recent call last):
    14: from bin/rails:4:in `<main>'
    13: from bin/rails:4:in `require'
    12: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<top (required)>'
    11: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command.rb:44:in `invoke'
    10: from /Users/groovy/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command.rb:70:in `find_by_namespace'
     9: from /Users/groovy/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:79:in `lookup'
     8: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:79:in `each'
     7: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:80:in `block in lookup'
     6: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:80:in `each'
     5: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
     4: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/command/behavior.rb:84:in `require'
     3: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands/console/console_command.rb:4:in `<top (required)>'
     2: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.1/lib/rails/commands/console/console_command.rb:4:in `require'
     1: from /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/irb/completion.rb:10:in `<top (required)>'
/Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/irb/completion.rb:10:in `require': dlopen(/Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
  Referenced from: /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle
  Reason: image not found - /Users/xxx/.rbenv/versions/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle
```
再度同じエラー発生

同じようなエラーが出ている人がいないかググってみると、、、あった！
既に8.0.1のreadlineはインストール済みとのことで,```/user/local/opt/readline/lib/libreadline.7.dylib```には存在してないことらしい。
ということで参考を元にシンボリックを貼ってみる。

```
$ ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/
$ bundle install --path vandor/bundle
$rails c
[1] pry(main)>
```
無事に解消できました。感謝です!

参考： https://qiita.com/koshilife/items/f47bcc2a3b3de756f5c9