Tag Archives: parent directory is world writable but not sticky

How to Solve Error: parent directory is world writable but not sticky

When installing pyenv locally, the following error occurred:

➜   brew install pyenv
==> Downloading https://github.com/yyuu/pyenv/archive/v20160310.tar.gz
Already downloaded: /Library/Caches/Homebrew/pyenv-20160310.tar.gz
Error: parent directory is world writable but not sticky
Please report this bug:
    https://git.io/brew-troubleshooting
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:92:in `mktmpdir'
/usr/local/Library/Homebrew/utils/fork.rb:6:in `safe_fork'
/usr/local/Library/Homebrew/formula_installer.rb:572:in `build'
/usr/local/Library/Homebrew/formula_installer.rb:231:in `install'
/usr/local/Library/Homebrew/cmd/install.rb:214:in `install_formula'
/usr/local/Library/Homebrew/cmd/install.rb:93:in `block in install'
/usr/local/Library/Homebrew/cmd/install.rb:93:in `each'
/usr/local/Library/Homebrew/cmd/install.rb:93:in `install'
/usr/local/Library/brew.rb:83:in `<main>'

Solution:
first check the read and write permissions of the folder of your own /private/tmp, as follows on my mac machine:

  ls -ld /tmp
lrwxr-xr-x@ 1 root  wheel  11 11 13  2014 /tmp -> private/tmp
  ls -ld /private/tmp
drwxrwxrwt  13 root  wheel  442  1 18 09:07 /private/tmp

In order to solve this’sticky’ permission of /private/tmp, you need to execute the following command:
sudo chmod +t /private/tmp/

After the execution, the installation is successful:

➜  brew install pyenv
==> Downloading https://github.com/yyuu/pyenv/archive/v20160310.tar.gz
Already downloaded: /Library/Caches/Homebrew/pyenv-20160310.tar.gz
==> Caveats
To use Homebrew's directories rather than ~/.pyenv add to your profile:
  export PYENV_ROOT=/usr/local/var/pyenv

To enable shims and autocompletion add to your profile:
  if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
==> Summary
🍺  /usr/local/Cellar/pyenv/20160310: 469 files, 2M, built in 0 seconds