Updating Homebrew

September 1, 2018

If you use Homebrew to manage your packages, you should make sure that you keep it up to date, which in turn will allow you to keep your individual packages up to date as well. I went through this process the other day in an effort to clean up my development environment. After doing some intel on the topic (googled 'how to update homebrew') I ran the following commands. brew update brew cleanup The first command updated Homebrew itself. The cleanup command goes through all of the formulae you have installed by Homebrew and removes any old versions, as well as scrubs the cache and removes any old downloads. Your mileage may vary, but when I ran the cleanup command, the output let me know that about 9GB of space was freed up on my disk. Nice. After I had an up to date Homebrew and a cleaned out cask room I ran the following command to upgrade the packages I had installed already. brew upgrade After all of this, I thought I was in good shape. Nope. Turns out that all of this updating and upgrading and cleanuping somehow affected my rbenv path, so I wasn't able to execute any commands related to ruby. Even the command: ruby -v gave me the error: line 21: /usr/local/Cellar/rbenv/0.4.0/libexec/rbenv: No such file or directory After searching around for a solution, I found that reinstalling rbenv was the solution brew uninstall rbenv Then brew install rbenv After that I had to append an initializer for zsh to find the proper path to rbenv and all of my gems: atom ~/.zshrc Edit the file by adding: eval "$(rbenv init -)" Open a new shell and everything should work, allowing you to get back to work!