Intento ejecutar mi, 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?
ruby-on-rails
ruby
ruby-on-rails-4
Zulhilmi Zainudin
fuente
fuente
Respuestas:
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 aquí . Allí también hay muchas personas que comparten sus soluciones.
fuente
ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
también puede ser una soluciónln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
Creo que debe verificar cuál está instalado en/usr/local/opt/readline/lib
y luego vincularlo alibreadline.6.dylib
. En mi caso, necesitaba vincular 6 a 8. En la respuesta @Zulhilmi vinculó 6 a 7.Agregue esta gema a su Gemfile y ejecute
bundle install
:gem 'rb-readline'
fuente
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, así que esto me está diciendo que está esperando
libreadline.7.dylib
en/usr/local/opt/readline/lib
. Cuando examino ese directorio, puedo ver que tengolibreadline.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
Asumí que emular mediante el uso de enlaces simbólicos paralibreadline.8.0.dylib
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 llamado a
psql
trabajar nuevamente, pero no aborda cómo comenzó el problema en primer lugar.fuente
Instalé el ruby de la misma versión nuevamente. Entonces el mensaje de error desapareció. 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
fuente
2.1.10
. Se corrigió reinstalándolo.rvm reinstall ruby-2.6.2
Acabo de recompilar la versión ruby usando readline actualizada de homebrew y funciona como un encanto.
rbenv install $(rbenv version-name)
fuente
Estaba teniendo el mismo tipo de problema, pero se debía 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
fuente
En mi caso, readline se instaló pero no se vinculó después de una migración de MacOS. Este comando lo solucionó:
fuente
simplemente reinstalando ruby 2.3.0 solucionó mi problema en macos que uso rbenv
rbenv install 2.3.0
hizo el trucofuente