Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot execute "rails console" due to an error with readline

I cannot execute rails console due to this error:

localhost:TwitterForZombies wiz$ rails c /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/irb/completion.rb:9:in `require': dlopen(/Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin12.2.1/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.2.dylib (LoadError)   Referenced from: /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin12.2.1/readline.bundle   Reason: image not found - /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin12.2.1/readline.bundle     from /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'     from /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands/console.rb:3:in `require'     from /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands/console.rb:3:in `<top (required)>'     from /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:38:in `require'     from /Users/wiz/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:38:in `<top (required)>'     from script/rails:6:in `require'     from script/rails:6:in `<main>' 

I have installed readline via homebrew. I'd like to keep using rbenv instead of rvm.

Thank you for reading my question.

like image 951
wiz Avatar asked May 26 '13 04:05

wiz


1 Answers

I had the same issue recently with homebrew and libreadline.7.x.dylib / libreadline.6.x.dylib

I solved it by running:

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

source: https://github.com/rails/rails/issues/26658

like image 98
Will Clarke Avatar answered Oct 03 '22 10:10

Will Clarke