zoukankan      html  css  js  c++  java
  • 问题处理:Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)

    进入rails 文件夹, terminal输入rails console报告❌。

    类似下面的

    Running via Spring preloader in process 13912
    Traceback (most recent call last):
        50: from -e:1:in `<main>'
        49: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        48: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        47: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'
        ...
         7: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
         6: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
         5: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
         4: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
         3: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
         2: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
         1: from /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
    /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require': dlopen(/Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle, 9): 
    Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
    Referenced from: /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle Reason: image not found - /Users/wemteq/.rbenv/versions/2.5.0/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle

    直接google, 

    Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)

    就能找到stackoverflow的答案。

    原因是homebrew更新了libhistory的版本到8.0。

    而rails的默认配置是7.0找不到对应的库。因此建立一个符号连接即可。

    cd /usr/local/opt/readline/lib/
    ls -l
    //可以看到这个文件夹下的文件的版本是libhistory.8.0.dylib
    //所以在这个文件夹下添加一个符号连接,使用命令ln -s(bash命令)
    ln -s libhistory.8.0.dylib libhistory.7.dylib 

    然后rails c就可以正确打开了。

  • 相关阅读:
    Asp.net中导出Excel文档(Gridview)
    以太坊难度炸弹是什么?极大抑制矿工继续以POW方式挖矿!
    Solidity语言基础 和 Etherum ERC20合约基础
    BCH/BSV coin split troubleshooting
    比特币学习-Transaction的locktime属性
    在BCH硬分叉后防止重放攻击-2
    在BCH硬分叉后防止重放攻击-1
    区块链硬分叉-软分叉简单了解
    BTC和BCH 区别和联系?
    BCHABC/BCHSV的矛盾所在
  • 原文地址:https://www.cnblogs.com/chentianwei/p/10475474.html
Copyright © 2011-2022 走看看