Rails:运行Rails控制台时遇到问题

时间:2018-09-28 03:10:43

标签: ruby-on-rails ruby

我在尝试使rails console正常工作时遇到很多麻烦。这很重要,是我迁移的新Macbook Pro。

我已经运行bundlebundle update ...

版本: 导轨5.2.1 Ruby 2.3.3

我得到的错误:

$ rails c
Running via Spring preloader in process 9953
/Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require': dlopen(/Users/joshuacesana/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-darwin17/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
Referenced from: /Users/joshuacesana/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-darwin17/readline.bundle
Reason: image not found - /Users/joshuacesana/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/x86_64-darwin17/readline.bundle
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
from /Users/joshuacesana/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/irb/completion.rb:10:in `<main>'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/railties-5.2.1/lib/rails/commands/console/console_command.rb:4:in `<main>'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/railties-5.2.1/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/railties-5.2.1/lib/rails/command/behavior.rb:80:in `each'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/railties-5.2.1/lib/rails/command/behavior.rb:80:in `block in lookup'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/railties-5.2.1/lib/rails/command/behavior.rb:79:in `each'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/railties-5.2.1/lib/rails/command/behavior.rb:79:in `lookup'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/railties-5.2.1/lib/rails/command.rb:70:in `find_by_namespace'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/railties-5.2.1/lib/rails/command.rb:44:in `invoke'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<main>'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
from /Users/joshuacesana/code/recipes/bin/rails:9:in `<main>'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `block in load'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
from /Users/joshuacesana/.rvm/gems/ruby-2.3.3/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:281:in `load'
from /Users/joshuacesana/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from /Users/joshuacesana/.rvm/rubies/ruby-2.3.3/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from -e:1:in `<main>'

这只是胡说八道,因为StackOverFlow说我需要更多细节。...享受一些“回到未来”的报价:

好的,我们是傻瓜。呃,不,不,不,不。屁股,你在看什么?你,你的权利。哇,红色,你看起来很棒。一切看起来很棒。 1:24,我还有时间。哦,我的上帝。不,不再,拜托,拜托。嘿。利比亚人。劳伦佐,帮我一下。噢,该死,伙计,我割了手。

那是乔治·麦克弗利。助焊剂电容器。那就对了。哦,哦,马蒂,这是您的钥匙。大家都准备就绪,准备今晚。回到未来。

很好。妈是你吗不,出城了,我妈妈认为我要和这些家伙一起露营。好吧,詹妮弗,如果她妈妈知道我要和你一起去,我会吓坏了。而且我得到了关于她小时候从未做过那种事情的标准演讲。现在看,我想她是天生的修女。什么?说,你为什么要让那些男孩像那样把你推开呢?

2 个答案:

答案 0 :(得分:2)

根据错误日志,您似乎缺少计算机上安装的libreadline。您可以尝试使用此link在Mac上安装readline

答案 1 :(得分:0)

尝试以下操作:brew install readline