Installing Homebrew with fish-shell

1

I recently had a mishap with MySQL and when I uninstalled it from System Preferences it uninstalled Homebrew as well (I checked the erase all files that are related to MySQL, which was probably not the right thing to do).

Anyways, I got everything back to normal but when I try to install Homebrew using the install script on their website:

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

I get this error:

fish: $(...) is not supported. In fish, please use '(curl)'.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

I tried complying with this error by eliminating the '$' and running:

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

I then get this error:

-e:1: syntax error, unexpected tLABEL, expecting keyword_do or '{' or '('
(curl -fsSL https://raw.githubusercontent.com/H...
                  ^
-e:1: unknown regexp options - raw

This is where I am stuck. I've tried to change my shell but fish is the only one listed in my shell files.

WaterTrash

Posted 2019-05-22T17:20:07.050

Reputation: 11

What is your os? – mohammad moeini – 2019-05-22T17:49:33.567

MacOS using iterm2 and fish shell – WaterTrash – 2019-05-22T20:33:24.883

Answers

1

Your second example just begins with (curl.... Which doesn't make any sense. Typo? This should work:

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

Also, you could also just run curl and save the script to a file (e.g., homebrew.rb) then tell ruby to execute that script: ruby homebrew.rb.

Kurtis Rader

Posted 2019-05-22T17:20:07.050

Reputation: 919

Shoot, I'm sorry, that is a typo. I edited the command to the correct one. – WaterTrash – 2019-05-22T20:29:10.603

Could you elaborate on the second part? When I run curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install I get a bunch of output and can't locate a homebrew.rb file. – WaterTrash – 2019-05-22T20:32:44.560

@WaterTrash your edit still says /usr/bin/ruby -e "$(curl... which is not valid fish syntax. Did you try the command I put in my answer? No quotes. No dollar-sign. As for using curl separate from ruby you need to tell curl to save the output: curl -o homebrew.rb .... – Kurtis Rader – 2019-05-22T20:57:23.197

Yes, I ran your command and there is no output at all. When I add -o I get: /usr/bin/ruby -e (curl -o -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install) % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 12427 100 12427 0 0 14788 0 --:--:-- --:--:-- --:--:-- 14776 /usr/bin/ruby: no code specified for -e (RuntimeError) – WaterTrash – 2019-05-23T15:37:01.560

@WaterTrash I give up. You have no business touching a shell command line. Using the -o flag is only if you run curl separate from ruby. And it needs to be followed by a file name. So you just downloaded the script into a file named -fsSl. The command I gave in my answer is correct and works. So either you're not running that from a fish shell prompt or you are not copy/pasting it without modifying it. – Kurtis Rader – 2019-05-23T18:09:36.883