I'm attempting to update my installation of Homebrew by re-installing as prescribed by http://brew.sh:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

When I run the above installation shell command, I receive this error :

ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]
-e:222: syntax error, unexpected '.', expecting $end
               .map { |d| File.join(HOMEBREW_PREFIX, d) }

Any thoughts?

  • Looks like your Ruby is too old, you probably need to find a way to upgrade it. – Kevin Mar 21 at 0:32
  • I updated to " Ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-darwin11.0] " by using MacPorts. I still receive the same error. – I_Don't_Code Mar 21 at 2:14
  • You sure the new version of ruby is the one in /usr/bin/? – Kevin Mar 21 at 2:27
  • As Kevin mentioned, leave out the /usr/bin when calling ruby. So your command should be ruby -e "$...". Also note that many formulas on Homebrew may no longer compile on 10.7 since it is deprecated. You might consider checking out an older version of the homebrew formulae from a time when 10.7 was supported (this will require you to manually modify formula if you want to keep up to date though) – 1110101001 Mar 21 at 3:52
  • If you need to stay on 10.7 which homebrew does not support it might be worth trying macports instead which does support earlier osx versions 10.6 reasonably well and for somethings 10.4 – Mark Mar 21 at 12:55

You must log in to answer this question.

Browse other questions tagged .