运行 source ~/.zshrc 命令的时候提示了以下错误;

zsh compinit: insecure directories, run compaudit for list. Ignore insecure directories and continue [y] or abort compinit [n]?

按照提示,运行了compaudit命令:

There are insecure directories: /usr/local/share/zsh/site-functions /usr/local/share/zsh

解决方法:

OSX 10.9及以下系统执行如下命令:

$ cd /usr/local/share/
$ sudo chown -R root:root site-functions

OSX 10.9以上系统执行如下命令(user:staff 是 OSX 系统默认权限):

$ cd /usr/local/share/
$ sudo chmod -R 755 zsh
$ sudo chown -R root:staff zsh

最后重新执行 source ~/.zshrc 命令即可。