2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# Common Issues
  
						 
					
						
							
								
									
										
										
										
											2017-01-04 16:16:00 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								This is a list of commonly encountered problems, known issues, and their solutions.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### `brew` complains about absence of "Command Line Tools"
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								You need to have the Xcode Command Line Utilities installed (and updated): run `xcode-select --install`  in the terminal.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-18 17:45:12 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Ruby: `bad interpreter: /usr/bin/ruby^M: no such file or directory`
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								You cloned with `git` , and your Git configuration is set to use Windows line endings. See this page: < https: // help . github . com / articles / dealing-with-line-endings > 
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-18 17:45:12 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Ruby: `bad interpreter: /usr/bin/ruby`
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								You don't have a `/usr/bin/ruby`  or it is not executable. It's not recommended to let this persist; you'd be surprised how many `.app` s, tools and scripts expect your macOS-provided files and directories to be *unmodified*  since macOS was installed.
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### `brew update` complains about untracked working tree files
  
						 
					
						
							
								
									
										
										
										
											2017-03-18 17:45:12 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								After running `brew update` , you receive a Git error warning about untracked files or local changes that would be overwritten by a checkout or merge, followed by a list of files inside your Homebrew installation.
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								This is caused by an old bug in in the `update`  code that has long since been fixed. However, the nature of the bug requires that you do the following:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```sh
							 
						 
					
						
							
								
									
										
										
										
											2021-09-13 20:32:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								cd "$(brew --repository)"
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								git reset --hard FETCH_HEAD
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								If `brew doctor`  still complains about uncommitted modifications, also run this command:
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```sh
							 
						 
					
						
							
								
									
										
										
										
											2021-09-13 20:32:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								cd "$(brew --repository)/Library"
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								git clean -fd
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### `launchctl` refuses to load launchd plist files
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								When trying to load a plist file into launchctl, you receive an error that resembles
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Bug: launchctl.c:2325 (23930):13: (dbfd = open(g_job_overrides_db_path, [...]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								launch_msg(): Socket is not connected
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								or
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Could not open job overrides database at: /private/var/db/launchd.db/com.apple.launchd/overrides.plist: 13: Permission denied
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								launch_msg(): Socket is not connected
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-12-02 03:25:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								These are likely due to one of four issues:
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								1.  You are using iTerm. The solution is to use Terminal.app when interacting with `launchctl` . 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								2.  You are using a terminal multiplexer such as `tmux`  or `screen` . You should interact with `launchctl`  from a separate Terminal.app shell. 
						 
					
						
							
								
									
										
										
										
											2018-10-05 17:23:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								3.  You are attempting to run `launchctl`  while logged in remotely. You should enable screen sharing on the remote machine and issue the command using Terminal.app running on that machine. 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								4.  You are `su` 'ed as a different user. 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### `brew upgrade` errors out
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								When running `brew upgrade` , you see something like this:
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								$ brew upgrade
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Error: undefined method `include?' for nil:NilClass
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Please report this bug:
							 
						 
					
						
							
								
									
										
										
										
											2018-02-22 18:47:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    https://docs.brew.sh/Troubleshooting
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								/usr/local/Library/Homebrew/formula.rb:393:in `canonical_name'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/usr/local/Library/Homebrew/formula.rb:425:in `factory'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/usr/local/Library/Contributions/examples/brew-upgrade.rb:7
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/usr/local/Library/Contributions/examples/brew-upgrade.rb:7:in `map'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/usr/local/Library/Contributions/examples/brew-upgrade.rb:7
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/usr/local/bin/brew:46:in `require'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/usr/local/bin/brew:46:in `require?'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/usr/local/bin/brew:79
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								This happens because an old version of the upgrade command is hanging around for some reason. The fix:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```sh
							 
						 
					
						
							
								
									
										
										
										
											2021-09-13 20:32:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								cd "$(brew --repository)/Library/Contributions/examples"
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								git clean -n # if this doesn't list anything that you want to keep, then
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								git clean -f # this will remove untracked files
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-05 17:23:22 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Python: `easy-install.pth` cannot be linked
  
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Warning: Could not link < formula > . Unlinking...
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Error: The `brew link`  step did not complete successfully
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The formula built, but is not symlinked into /usr/local
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								You can try again using `brew link < formula > '
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Possible conflicting files are:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/usr/local/lib/python2.7/site-packages/site.py
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/usr/local/lib/python2.7/site-packages/easy-install.pth
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								==> Could not symlink file: /homebrew/Cellar/< formula > /< version > /lib/python2.7/site-packages/site.py
							 
						 
					
						
							
								
									
										
										
										
											2014-10-26 14:54:36 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Target /usr/local/lib/python2.7/site-packages/site.py already exists. You may need to delete it.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To force the link and overwrite all other conflicting files, do:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  brew link --overwrite formula_name
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To list all files that would be deleted:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  brew link --overwrite --dry-run formula_name
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-03-13 20:48:44 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Don't follow the advice here but fix by using
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								`Language::Python.setup_install_args`  in the formula as described in 
						 
					
						
							
								
									
										
										
										
											2018-02-23 19:39:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								[Python for Formula Authors ](Python-for-Formula-Authors.md ).
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 12:38:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-18 19:57:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Upgrading macOS
  
						 
					
						
							
								
									
										
										
										
											2015-12-14 12:38:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-18 19:57:19 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Upgrading macOS can cause errors like the following:
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 12:38:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  `dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.54.dylib`  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  `configure: error: Cannot find libz`  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-18 17:45:12 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Following a macOS upgrade it may be necessary to reinstall the Xcode Command Line Tools and `brew upgrade`  all installed formula:
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 12:38:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-25 22:53:33 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```sh
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 12:38:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								xcode-select --install
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								brew upgrade
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2021-02-13 14:37:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-04-01 15:51:00 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Other local issues
  
						 
					
						
							
								
									
										
										
										
											2021-02-13 14:37:54 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-05-05 10:08:21 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								If your Homebrew installation gets messed up (and fixing the issues found by `brew doctor`  doesn't solve the problem), reinstalling Homebrew may help to reset to a normal state. To easily reinstall Homebrew, use [Homebrew Bundle ](https://github.com/Homebrew/homebrew-bundle ) to automatically restore your installed formulae and casks. To do so, run `brew bundle dump` , [uninstall ](https://docs.brew.sh/FAQ#how-do-i-uninstall-homebrew ), [reinstall ](https://docs.brew.sh/Installation ) and run `brew bundle install` .