環境
- Ruby 2.6.0
- Rails 5.2.2
- MacOS
症状
rails c でコンソール起動時に
dlopen(/{ユーザーのパス}/.rbenv/versions/2.6.0/lib/ruby/2.6.0/x86_64-darwin17/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
Referenced from: /{ユーザーのパス}/.rbenv/versions/2.6.0/lib/ruby/2.6.0/x86_64-darwin17/readline.bundle
Reason: image not found - /{ユーザーのパス}/.rbenv/versions/2.6.0/lib/ruby/2.6.0/x86_64-darwin17/readline.bundle
解決法
https://github.com/rails/rails/issues/26658
ここらへんを参考に、gem fileのdevelopmentグループにを追加
Gemfile
group :development do
...
gem 'rb-readline'
end