After I install the gettext in my mac:

I use the brew install gettext command installed it.

CPPFLAGS: -I/usr/local/opt/gettext/include

==> Summary
🍺  /usr/local/Cellar/gettext/ 1,934 files, 16.9MB

I can not use the gettext still.

$ gettext --help
-bash: gettext: command not found

That formula doesn't link - you can do it by hand if you require it:

This formula is keg-only, which means it was not symlinked into /usr/local, because macOS provides the BSD gettext library & some software gets confused if both are in the library path.

The maintainers recommend:

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

You can even get a more explicit warning by trying to link it manually:

$brew link gettext.

Warning: gettext is keg-only and must be linked with --force.

Note that doing so can interfere with building software.

If you're sure you need it linked everywhere:

brew link gettext --force

See this SU thread for details https://superuser.com/questions/747324/brew-install-gettext-should-i-force-link-it

  • Also you can add it to oh-my-zsh -> echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.zshrc – Gandarez Aug 30 at 21:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .