[SOLVED] Installation fails with syntax error on Lion

I am running Lion 10.7.5 and installation fails with this error :

MyMac:~ hali$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-e:222: syntax error, unexpected '.', expecting $end
               .map { |d| File.join(HOMEBREW_PREFIX, d) }
MyMac:~ hali$ xcode-select -version
xcode-select version 2308.

As you can see I have CLT installed.

Similarly uninstall fails :

MyMac:~ hali$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
-e:165: syntax error, unexpected '.', expecting $end
                          .select { |line| line.start_with? "!" }

curl retrieves the file OK and ‘ruby -v’ shows :
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]

Am I missing something as Installation page doesn’t mention 10.7 - only

10.9–10.11 are supported on a best-effort basis. For 10.4-10.6 see Tigerbrew.

Neither Tigerbrew nor Homebrew support macOS Lion. Tigerbrew may work for you but Homebrew definitely will not, sorry.

1 Like

The instructions from @SMillerDev in post linked below got it working - ie install Tigerbrew and then migrate to Homebrew. Seems to work well enough even if it is unsupported.

My 10.8 machine recently stopped receiving Homebrew updates as well since the “disable pre-Mavericks” commit landed.

Forcing install from an older commit works for a moment, but then Homebrew tries to auto-update and then everything just dies (somewhat expected as it attempts to update automatically).

I’ve switched the 10.8 machine to Tigerbrew and it’s working so far (just installed cmake, git, maven successfully). Naturally, packages have to be built from source, but that’s been the norm for a while. :slight_smile:

Unfortunately the aforementioned SSL issues with git persist, so I’m not sure how viable this will be for others.