​Error: No such file or directory @ rb_sysopen - /HOME/tmp/github_api_headers20170113-4608-17yraui​

Perhaps either the environment variables TMPDIR or HOMEBREW_TEMP is set incorrectly. Does the directory /HOME/tmp exist? Is HOME meant to be capitalized? Try perhaps

export HOMEBREW_TEMP=/tmp
brew update

@sjackman After upgrading to high sierra I was running:
$ brew doctor

and getting

Error: No such file or directory @ rb_file_s_stat - /usr/local/temp

Running

export HOMEBREW_TEMP=/tmp
brew update