2016-11-18 17 views
15

Tôi cố gắng chạy của tôi rails c nhưng đối với một số lý do, tôi nhận được lỗi này:Thư viện không nạp: /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>’ 

Tôi nên làm gì bây giờ?

Trả lời

0

câu hỏi này đã được trả lời ở đây rồi, Xem liên kết này, rails c not working in rails 5 Tôi cũng trả lời trong nhóm slack của chúng tôi.

89

Lệnh này khắc phục vấn đề của tôi:

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

Cảm ơn Shawn Wilson.

+1

Làm việc nhờ tuyệt vời cho chia sẻ rằng – ALFmachine

+3

Simple sửa chữa một dòng. Cảm ơn bạn đã chia sẻ ... đã cứu tôi xé tóc ra;) – Marcus

+0

Tuyệt vời, cảm ơn, làm việc cho tôi! –

4

Thêm đá quý này để Gemfile của bạn và chạy bundle install:

gem 'rb-readline' 
Các vấn đề liên quan