【问题标题】:Install icu4c version 63 with Homebrew使用 Homebrew 安装 icu4c 版本 63
【发布时间】:2019-09-13 12:35:35
【问题描述】:

我试图启动 psql 但得到了

psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

当我使用postgres -D /usr/local/var/postgres时,出现以下错误:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib
  Referenced from: /usr/local/bin/postgres
  Reason: image not found
[1]    2559 abort      postgres -D /usr/local/var/postgres

libicui18n.63.dylib 的快速搜索显示我需要版本为63 的icu4c 库。但是brew list icu4c 说我的版本为64.2。

我尝试了brew install icu4c 63brew install icu4c@63,但都没有成功。

有人可以帮忙吗?提前致谢。

【问题讨论】:

    标签: postgresql homebrew icu4c


    【解决方案1】:

    解决方案:

    1. cd 到 Homebrew 的公式目录
    • 英特尔
      cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
      
    • M1
      cd $(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula
      
    1. 找到所需的提交(icu4c 的版本 63)以结帐
    git log --follow icu4c.rb
    
    1. 结帐到新分支
    git checkout -b icu4c-63 e7f0f10dc63b1dc1061d475f1a61d01b70ef2cb7
    
    1. 用新版本重新安装库
    brew reinstall ./icu4c.rb
    
    1. 切换到重新安装的版本
    brew switch icu4c 63.1
    
    1. 结帐回到主人
    git checkout master
    

    来源:

    对于那些最终多次使用此功能的人的奖励:

    # zsh
    function hiicu63() {
      local last_dir=$(pwd)
    
      cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
      git checkout icu4c-63
      brew reinstall ./icu4c.rb
      brew switch icu4c 63.1
      git checkout master
    
      cd $last_dir
    }
    

    【讨论】:

    • 顺便说一句,如果有人知道更好/更简单的方法来做到这一点并分享,我将不胜感激:)
    • 在 brew 中安装旧版本的绝妙方法,比我见过的其他方法容易得多,非常感谢!
    • 这成功了!但听起来它有可能让我的机器变砖!我的情况是:安装了phpbrew php7.3,然后npm和node都不起作用
    • 很安全。在最坏的情况下,您将不得不重新安装 php/node。 :)
    • 如果由于某种原因在 git log 中看不到你需要的版本,你可以尝试下载之前的完整历史,git -C "$(brew --repo homebrew/core)" fetch --unshallow
    【解决方案2】:

    就像@dingusjh 所说,但使用reinstall 命令而不是install,以防 brew 抱怨已经安装了 icu4c,你应该尝试extract。完整的命令将是:

    brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/e7f0f10dc63b1dc1061d475f1a61d01b70ef2cb7/Formula/icu4c.rb
    

    【讨论】:

      【解决方案3】:

      这应该更容易。

      brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e7f0f10dc63b1dc1061d475f1a61d01b70ef2cb7/Formula/icu4c.rb
      

      【讨论】:

      • 我过去曾将此方法与其他公式一起使用,但在这种情况下不起作用。给了我一个使用brew extract的建议,并且警告“icu4c 63.1 is already installed and up-to-date \n要重新安装63.1,运行brew reinstall icu4c”......运行重新安装命令重新安装了最新的(64.2截至本写作)。不知道这是否是新的 brew 行为或错误或什么。回到 ogirginc 的回答中,从本地 brew tap 获取它
      【解决方案4】:

      对我来说,重新安装 icu4c 工作 brew reinstall icu4c

      【讨论】:

        猜你喜欢
        • 2019-12-02
        • 2014-12-14
        • 1970-01-01
        • 1970-01-01
        • 2017-07-08
        • 1970-01-01
        • 2013-08-05
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多