Category Archives: Homebrew

Homebrew: “Invalid Multibyte Escape” Error

PROBLEM

When running brew on OS X Maverick, you get this error:-

Error: /usr/local/Library/Homebrew/download_strategy.rb:84: invalid multibyte escape: /^\037\213/
invalid multibyte escape: /^\037\235/
Please report this bug: https://github.com/mxcl/homebrew/wiki/Checklist-before-filing-a-new-issue
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'

SOLUTION

After upgrading to OS X Mavericks, the default version of Ruby is v2.0, causing Homebrew to break because it relies on v1.8. See issue #23655 for more information.

To fix this, run the following command:-

brew update

If you are getting the “Permission Denied” errors when running the above command, run the following command to fix the permission problem:-

# Assuming your user name is USER_HERO
sudo chown -R USER_HERO:admin /usr/local
cd /usr/local
git reset --hard origin/master
brew update

“tree” Command on Mac OS X

So, I have been drawing the ASCII file structure tree by hand lately… and that is dumb and time consuming. After digging around, I found a great way to do so.

First, if you don’t have Homebrew, install it first.

Run the following command to install the tree command:-

brew install tree

Now, you can run the following command to create a tree:-

tree [directory]

For example:

tree testMe

… generates:-

testMe
├── src
├── testMe.iml
└── web
    ├── WEB-INF
    │   ├── lib
    │   └── web.xml
    └── index.jsp