msgmerge on macos Catalina

旧街凉风 提交于 2020-05-28 05:32:16

问题


I am trying to run a unix command line for some i18n work on a project. Using gettext library my issue is about running msgmerge

$ msgmerge
zsh: command not found: msgmerge

I tried brew instal gettext and brew link gettext but with no success. This was working well on my previous machine, but can't make it work on a fresh install.

I can confirm binary is available in /usr/local/opt/gettext/bin/msgmerge.


回答1:


Fixed. When running brew reinstall gettext, command actually give the answer:

If you need to have gettext first in your PATH run:
  echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.zshrc

Export is only triggered when opening a new zsh prompt, PATH was not updated yet and worked when I re-openned a new window.




回答2:


I tried running this brew link gettext --force, but I was getting:

$ brew install gettext
Warning: gettext 0.20.2 is already installed and up-to-date
To reinstall 0.20.2, run `brew reinstall gettext`

$ brew link gettext --force
Warning: Refusing to link macOS provided/shadowed software: gettext
If you need to have gettext first in your PATH run:
  echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

For compilers to find gettext you may need to set:
  export LDFLAGS="-L/usr/local/opt/gettext/lib"
  export CPPFLAGS="-I/usr/local/opt/gettext/include"

Then, I just added it to the system path with:

echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile

Related:

  1. https://apple.stackexchange.com/questions/299048/can-not-use-the-gettext-which-is-installed-by-brew
  2. Homebrew refusing to link OpenSSL
  3. How to install gettext on MacOS X
  4. Installed, just not linked


来源:https://stackoverflow.com/questions/59644349/msgmerge-on-macos-catalina

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