1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

bundle exec rails consoleが実行できないエラー

Last updated at Posted at 2017-09-29

概要

$ bundle exec rails console を実行すると、

Running via Spring preloader in process 38930
~/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:
in `require': dlopen(~/.rbenv/versions/2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded:
/usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
Referenced from: ~/.rbenv/versions/2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
Reason: image not found - ~/.rbenv/versions/2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle

とエラーを吐いた。

解決方法

stackoverflow様を参照
https://stackoverflow.com/questions/16756287/cannot-execute-rails-console-due-to-an-error-with-readline

他の人も下記で解決していたようなのでそれに倣う

$ ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib

結果

ものの見事に解決!!

しかし、肝心のエラーの意味が理解できていない。

コメントを見てみると

A brew update && brew upgrade brought in libreadline.7.x.dylib while automatically removing libreadline.6.x.dylib, which ruby was still relying on.

とある。

つまり、以前に実行していた brew update によって自動的に libreadline.7.x.dylibが導入され、
必要とされるlibreadline.6.x.dylibが抹消されていたことが原因であった。

libreadline.6.x.dylibについては自分の知識外であったので何か補足できることがあれば追記していきたい。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?