Skip to content

Instantly share code, notes, and snippets.

def self.symbolize_keys(hash)
hash.inject({}){|result, (key, value)|
new_key = case key
when String then key.to_sym
else key
end
new_value = case value
when Hash then symbolize_keys(value)
when Array then value.map{ |v| v.is_a?(Hash) ? symbolize_keys(v) : v }
else value
@ncri
ncri / gist:6533964
Last active December 22, 2015 21:29
HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install sphinx --mysql 2>&1
Error: undefined method `head' for #<SoftwareSpec:0x11030f910>
Please report this bug:
https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Library/Formula/sphinx.rb:24
/usr/local/Library/Homebrew/formula.rb:722:in `instance_eval'
/usr/local/Library/Homebrew/formula.rb:722:in `resource'
/usr/local/Library/Formula/sphinx.rb:23
/usr/local/Library/Homebrew/formulary.rb:40:in `require'