Install icu4c version 63 with Homebrew

試著忘記壹切 提交于 2019-11-29 01:42:01

问题


I was trying to start psql but got

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"?

When I used postgres -D /usr/local/var/postgres, got the following error:

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

A quick search on libicui18n.63.dylib showed me I need icu4c lib with version 63. However brew list icu4c says I have the version 64.2.

I tried both brew install icu4c 63 & brew install icu4c@63 but no luck.

Can anyone help, please? Thanks in advance.


回答1:


Solution:

1) cd to Homebrew's formula directory

cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula

2) Find desired commit (version 63 for icu4c) to checkout

git log --follow icu4c.rb

3) Checkout to a new branch

git checkout -b icu4c-63 e7f0f10dc63b1dc1061d475f1a61d01b70ef2cb7

4) Reinstall the library with the new version

brew reinstall ./icu4c.rb

5) Switch to the reinstalled version

brew switch icu4c 63.1

6) Checkout back to master

git checkout master

Sources:

  • Homebrew install specific version of formula?
  • http://hanxue-it.blogspot.com/2018/08/macos-homebrew-installing-older-version-of-software.html



回答2:


Like @dingusjh says, but use reinstall command instead of install in case brew complains about having icu4c installed already and you should try to extract. The complete command would then be:

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



回答3:


This should be easier.

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


来源:https://stackoverflow.com/questions/55826221/install-icu4c-version-63-with-homebrew

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!