The output of thefuck --version (something like The Fuck 3.1 using Python 3.5.0):
mac:~ jabbson$ thefuck --version
The Fuck 3.27 using Python 3.6.5
Your shell and its version (bash, zsh, Windows PowerShell, etc.):
mac:~ jabbson$ echo $SHELL
/bin/bash
Your system (Debian 7, ArchLinux, Windows, etc.):
Mac OS
How to reproduce the bug:
mac:~ jabbson$ brew cleanup
Removing: /usr/local/Cellar/thefuck/3.26... (94 files, 818.7KB)
Error: Directory not empty @ dir_s_rmdir - /usr/local/Cellar/thefuck/3.26
Anything else you think is relevant:
Uninstalling also fails:
mac:~ jabbson$ brew uninstall thefuck
Uninstalling /usr/local/Cellar/thefuck/3.27... (840 files, 7.7MB)
thefuck 3.26 1 is still installed.
Remove all versions with `brew uninstall --force thefuck`.
mac:~ jabbson$ brew uninstall --force thefuck
Uninstalling thefuck... (94 files, 818.8KB)
Error: Directory not empty @ dir_s_rmdir - /usr/local/Cellar/thefuck/3.26
mac:~ jabbson$
The content of the folder:
mac:~ jabbson$ cd /usr/local/Cellar/thefuck/3.26
mac:3.26 jabbson$ ls -la
total 0
drwxr-xr-x 3 jabbson admin 96 27 May 17:31 .
drwxr-xr-x 3 jabbson admin 96 28 May 09:04 ..
drwxr-xr-x 3 jabbson admin 96 28 May 08:42 libexec
mac:3.26 jabbson$
Possible reason:
mac:python3.6 jabbson$ pwd
/usr/local/Cellar/thefuck/3.26/libexec/lib/python3.6
mac:python3.6 jabbson$ ls -la
total 0
drwxr-xr-x 5 jabbson admin 160 28 May 08:42 .
drwxr-xr-x 3 jabbson admin 96 25 Apr 10:19 ..
drwxr-xr-x 42 root admin 1344 30 Apr 17:12 __pycache__ <<<<<< ownership of the directory
drwxr-xr-x 3 jabbson admin 96 28 May 08:42 distutils <<<<<< root stuff inside too
drwxr-xr-x 8 jabbson admin 256 28 May 08:42 site-packages <<<<<< root stuff inside too
Recursive chown'ing these folders to be jabbson:admin did solve the issue for me
Same here, only it was php and a var folder with root user ownership. Solved by chown. :+1:
thank you. solved my problem. 馃憤
This is a bug in Homebrew: Homebrew/brew#4989
Most helpful comment
Recursive chown'ing these folders to be jabbson:admin did solve the issue for me