2016-11-18 76 views
15

我嘗試運行我的rails c但出於某種原因,我得到這個錯誤:庫未加載:/usr/local/opt/readline/lib/libreadline.6.dylib(LoadError)

https://gist.github.com/anonymous/166713e8cde860fb188a8dffb98a1563

ᐅ rails c 
Running via Spring preloader in process 6609 
/Users/zulhilmi/.rvm/gems/[email protected]/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/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/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/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/railties-4.2.6/lib/rails/commands/console.rb:3:in `<top (required)>' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:123:in `require_command!' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:58:in `console' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/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/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `load' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:268:in `block in load' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency' 
    from /Users/zulhilmi/.rvm/gems/[email protected]/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>’ 

現在該怎麼辦?

回答

89

此命令解決我的問題:

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

感謝肖恩·威爾遜。

+1

用於共享 – ALFmachine

+3

簡單的單行修復工作非常感謝。謝謝你的分享......救了我,把頭髮撕了出來;) – Marcus

+0

很好,謝謝,對我有用! –

4

這塊寶石添加到您的Gemfile和運行bundle install

gem 'rb-readline' 
相關問題