ruby on rails - rails - Biblioteca no cargada:/usr/local/opt/readline/lib/libreadline.6.dylib(LoadError)
ruby on rails tutorial (9)
Intento ejecutar mis
rails c
pero por alguna razón, aparece este error:
https://gist.github.com/anonymous/166713e8cde860fb188a8dffb98a1563
ᐅ rails c
Running via Spring preloader in process 6609
/Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'': dlopen(/Users/zulhilmi/.rvm/rubies/ruby-2.3.1/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: /Users/zulhilmi/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
Reason: image not found - /Users/zulhilmi/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require''
from /Users/zulhilmi/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/irb/completion.rb:10:in `<top (required)>''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands/console.rb:3:in `<top (required)>''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:123:in `require_command!''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:58:in `console''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require''
from /Users/zulhilmi/hello_gold/cws/bin/rails:8:in `<top (required)>''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency''
from /Users/zulhilmi/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load''
from /Users/zulhilmi/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require''
from /Users/zulhilmi/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require''
from -e:1:in `<main>’
¿Qué debería hacer ahora?
Agregue esta gema a su Gemfile y ejecute la
bundle install
:
gem ''rb-readline''
En mi caso, readline se instaló pero no se vinculó después de una migración de MacOS. Este comando lo arregló:
brew link --force readline
Estaba teniendo el mismo tipo de problema, pero se debió al hecho de que mi awk estaba vinculado a gawk, lo que me llevó a usar la biblioteca incorrecta
esto funcionó para mí
brew unlink gawk
Este comando soluciona mi problema:
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
O
ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
Escribí un Gist sobre este problema here . Hay muchas personas que comparten sus soluciones allí también.
Instalé el rubí de la misma versión nuevamente. Entonces el mensaje de error se ha ido ahora. Yo uso macbook y homebrew.
$ rbenv install 2.3.8
rbenv: /Users/klee/.rbenv/versions/2.3.8 already exists
continue with installation? (y/N) y
ruby-build: use openssl from homebrew
Downloading ruby-2.3.8.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.bz2
Installing ruby-2.3.8...
ruby-build: use readline from homebrew
Installed ruby-2.3.8 to /Users/klee/.rbenv/versions/2.3.8
Solo recompilé la versión ruby usando readline actualizado de homebrew y funciona de maravilla.
rbenv install $(rbenv version-name)
Tuve el mismo problema subyacente, que también ocurrió después de una actualización de Mac OSX. Mi problema se manifestó usando psql:
>> psql --help
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/bin/psql
Reason: image not found
OK, entonces esto me está diciendo que espera
libreadline.7.dylib
en
/usr/local/opt/readline/lib
.
Cuando busco en ese directorio, puedo ver que tengo
libreadline.8.0.dylib
:
>> ls -l /usr/local/opt/readline/lib
total 1448
libhistory.8.0.dylib
libhistory.8.dylib -> libhistory.8.0.dylib
libhistory.a
libhistory.dylib -> libhistory.8.0.dylib
libreadline.8.0.dylib
libreadline.8.dylib -> libreadline.8.0.dylib
libreadline.a
libreadline.dylib -> libreadline.8.0.dylib
libreadline.7.dylib
que emular
libreadline.7.dylib
usando symlinking a
libreadline.8.0.dylib
podría resolver mi problema:
>> ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
Lo que hace que mi llamada a
psql
funcione nuevamente, pero no aborda cómo comenzó el problema en primer lugar.
Tuve el mismo problema, lo que me ayudó fue
parada de primavera
simplemente reinstalar ruby 2.3.0 solucionó mi problema en macos que uso rbenv
rbenv install 2.3.0
hizo el truco