読者です 読者をやめる 読者になる 読者になる

Make Local Happiness

自分の幸せは自分で作る!!!

rails consoleが動かない Library not loaded: /usr/local/opt/readline/lib/libreadline.6.2.dylib (LoadError)

rails console が動かない。。

ぐぐってみるとreadlineがないからっぽいが、

readline はすでにbrew install したはずなのに、、、

 

もしかして、と思い、

brew linkやってみたらなおりました。

めでたし、めでたし

 

最初はこんな感じ

 $ rails console

/usr/local/var/rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/irb/completion.rb:9:in `require': dlopen(/usr/local/var/rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.5.0/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.2.dylib (LoadError)

  Referenced from: /usr/local/var/rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.5.0/readline.bundle

  Reason: image not found - /usr/local/var/rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.5.0/readline.bundle

from /usr/local/var/rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/irb/completion.rb:9:in `<top (required)>'

from /usr/local/var/rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands/console.rb:3:in `require'

from /usr/local/var/rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands/console.rb:3:in `<top (required)>'

from /usr/local/var/rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:51:in `require'

from /usr/local/var/rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:51:in `<top (required)>'

from bin/rails:4:in `require'

from bin/rails:4:in `<main>'

 

リンクさせる

$ brew link readline

Warning: readline is keg-only and must be linked with --force

Note that doing so can interfere with building software.

 

 #おこられたので、--forceをつけてみる

$ brew link readline --force

Linking /usr/local/Cellar/readline/6.2.4... 12 symlinks created

 

 

コンソールを再度実行

$ rails console

Loading development environment (Rails 4.0.2)

irb(main):001:0>