brew cask commands don't function because a package has a broken header

I was getting the follow error when running brew upgrade or cask commands

Error: Cask 'haskell-for-mac' is unreadable: undefined method `dots_to_slashes' for "1473.1526101439":Cask::DSL::Version

After running brew uninstall, brew purge, brew doctor and having no luck resolving the issue I headed over to

/usr/local/Caskroom

and then just did

rm -rf haskell-for-mac

Problem solved - not what I would have expected but it worked.

How do I update zsh to the latest version (not Apple's default)?

I like to use Homebrew to install and manage the software on my Mac hence these instructions are brew specific.

First, check the zsh info

$ brew info zsh

Most likely you'll see Apple's version so let's install zsh from Homebrew

$ brew install zsh

Once that's completed you'll need to edit your shells file to add the new shell path

$ sudo vi /etc/shells

Scroll to the end of the file and add the following line

/usr/local/bin/zsh

After you save that edit you'll need to update the default shell

$ chsh -s /usr/local/bin/zsh

Zsh is now upgraded. I also recommend installing Oh My Zsh. The handy upgrade command once installed is below

$ upgrade_oh_my_zsh

How to make the most current version of git available on macOS

macOS and Xcode are always a few releases behind the currently available version of git. There are just a few simple things you need to do in order to rectify this inequity. If you are reading this then you are probably already familiar with the git CLI commands, but just to be sure:

  • check the version of git
ewilson$ git version
git version 2.9.3 (Apple Git-75)
  • check to see where git is being executed from
ewilson$ which git
/usr/bin/git

If your system looks like this then you'll need to modify your .bash_profile (if you run bash - or modify the profile file for your corresponding shell). Since I am going to use homebrew for the new git install I need to make sure the path of the new executable (brew installs in /usr/local/bin) comes before the macOS version which is typically located in /usr/bin. Thusly:

export PATH=/usr/local/bin:$PATH

Now all that's left is to install git and you are golden

ewilson$ brew install git
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
metricbeat
==> Updated Formulae
...

==> Downloading https://homebrew.bintray.com/bottles/git-2.10.2.sierra.bottle.1.tar.
######################################################################## 100.0%
==> Pouring git-2.10.2.sierra.bottle.1.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d

zsh completion has been installed to:
/usr/local/share/zsh/site-functions

Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/git
==> Summary
🍺/usr/local/Cellar/git/2.10.2: 1,445 files, 31.8M

Now when you run git version you should see the latest and greatest

ewilson$ git version
git version 2.10.2

Awesome. To keep things up to date all you'll need to do is run brew upgrade

brew upgrade git

Don't forget to update any tools or IDEs that you may have been using to make sure that they now point at your shiny new version of git.