.zshenv ã§ PATH ã管çãããç½ ã«ããã£ã
Spacemacs ãèµ·åããã¨ã.zshrc
ã§ PATH
ã®è¨å®ããããªãã¨æããããã®ã§ã.zshenv
ã«è¨è¿°ãç§»ãã¨ãä»åº¦ã¯ä¸å
·åãèµ·ãããemacs ã以ä¸ã®ãã¼ã¸ã®è¨å®ããã¦å¼ã³åºã㨠~/bin/emacs
ãå®è¡ãã¦ããã®ãã .zshenv
ã« PATH ãç§»ãããã¨ã«ãã£ã¦ /usr/local/bin/emacs
ãå¼ã³åºãããã«ãªã£ã¦ãã¾ã£ãã
解決ããã®ã§ã¡ã¢ããã
åå ã®ç¹å®
$ echo $PATH
ãããã¨ã/usr/local/bin
ã ~/bin
ããåªå
çã«èªã¿è¾¼ã¾ãã¦ããã
ãªã®ã§ã試ãã« .zshenv
ã«
PATH="$HOME/bin"
ã¨ãã¦ã¿ã¦ãã
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/karur4n/bin
ã¨åºåãããã
ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ ãªãã§ ï¼ï¼ï¼ï¼ï¼ï¼ï¼
調ã¹ã¦ã¿ãã¨ãã·ã§ã«ãã°ã¤ã³æã« /etc/profile
ãèªã¿è¾¼ãã§ãã¦ãããã«ãã path_helper
ãåé¡ãå¼ãèµ·ããã¦ããã
/etc/profile
... ... if [ -x /usr/libexec/path_helper ]; then eval `/usr/libexec/path_helper -s` fi ... ...
path_helper
ã¯ãã¤ããªãã¡ã¤ã«ãªã®ã§ããªã«ããã¦ããã㯠man
ã§ç¥ãã
$ man path_helper
path_helper(8) BSD System Manager's Manual path_helper(8)
NAME path_helper -- helper for constructing PATH environment variable
SYNOPSIS path_helper [-c | -s]
DESCRIPTION
The path_helper utility reads the contents of the files in the directo- ries /etc/paths.d and /etc/manpaths.d and appends their contents to the PATH and MANPATH environment variables respectively. (The MANPATH envi- ronment variable will not be modified unless it is already set in the environment.)
Files in these directories should contain one path element per line.
Prior to reading these directories, default PATH and MANPATH values are obtained from the files /etc/paths and /etc/manpaths respectively.
è¦ã¯ path_helper
ã¯ãç¹å®ã®ãã¡ã¤ã«ã«ãã£ã¬ã¯ããªãæ¸ãã¦ããã¨ãããã PATH ã¨ãã¦èªã¿è¾¼ãã§ããããã®ã§ããã
PATH ã®å¤ãåå¾ããã /etc/paths
ãè¦ãã
/etc/paths
/usr/local/bin /usr/bin /bin /usr/sbin /sbin
ããããä¸è¨ã® $ echo $PATH
æã«åæã«èªã¿è¾¼ã¾ãããã®ã¨ä¸è´ãã¦ããã®ã§ãpath_helper ãä»åã®åé¡ã®å¼ãéã ã¨æå®ããã
El Capitan ããã§ããªããªã£ã坾妿³
ä¼¼ããããªè©±ããã£ã¦ãå¯¾çæ³ãæ¸ãã¦ãã£ãã
ããã¯ã以ä¸ãå®è¡ã㦠path_helper ããå®è¡æ¨©éããªããã¢ããã¼ãã
$ sudo chmod -x /usr/libexec/path_helper
ã§ããã§ãããã§ããããããªã㦠El Capitan ãã㯠rootless ã£ã¦ããã»ãã¥ãªãã£ã§ãã¦ã¼ã¶ã /System
, /bin
, /sbin
, /usr
ã«å¤æ´ãå ããããªãããã«ãªã£ã¦ãããsudo ãã¦ããhomebrew ã§é¨ãã«ãªã£ãã¢ã¬ã
Mac - Homebrewã¯El Capitanã¸ã¢ããã°ã¬ã¼ãããåã«å ¥ãã¦ãã - Qiita
ãªã®ã§ãããã¯ã§ããªãã
解決ãã
ã©ããã£ã¦è§£æ±ºãããã¨è¨ãã¨ãzsh ã«ã¯ path_helper ãå¼ã³åºãã¦ãã /etc/profile
ãèªã¿è¾¼ã¾ãªãè¨å®ãããã®ã§ããããæå¹ã«ããã
.zshenv
setopt no_global_rcs
ããã§ããã試ãã«ãPATH ã表示ãã¦ã¿ãã
.zshenv
setopt no_global_rcs PATH="$HOME/bin"
$ echo $PATH ~/bin
ãã£ãã¼ ð
ãã ãããã¾ã§ã®ããã«ã/usr/local/bin
ãªã©ãèªåã§èªã¿è¾¼ã¾ãããã¨ã¯ãªããªã£ãã®ã§ãåèªãPATH ãèªã¿è¾¼ãå¿
è¦ãããã
ããã£ãããã