On my personal and work machines, when running brew update
today I ran into this issue:
I had no idea what it meant, but it looked like a Ruby error, so I tried to dig into what this was all about.
I did a lot of ag
(brew install the_silver_searcher
) searching of the /usr/local directory, trying to find what “undent” was all about, and it appears to be some helper method added to the Ruby String
class, but it’s only used inside of automated tests for Homebrew, and not available as part of a cask definition. A bug?
For now, the fix was easy: remove .undent
from the java.rb cask definition on my machines.
The fix
- Find the java.rb cask file on your local machine
find /usr/local/Caskroom -name 'java.rb'
- Mine was here:
/usr/local/Caskroom/java/.metadata/1.8.0_144-b01,090f390dda5b47b9b721c7dfaa008135/20170827132848.522/Casks/java.rb
- Edit that file
- Find this line around line 95:
caveats <<-EOS.undent
and change it tocaveats <<-EOS
- Save the file
- Run
brew update
or whateverbrew
command you were trying to run.