The Error

The Fix

Make homebrew think /System/Library/Frameworks/Ruby.framework/Versions/1.8 still exists until you successfully update: