Brew doctor not working on Mac

Hi I have tried to installed home-brew via terminal on Mac, it gives installation succesful but ik does not work.

This is what I get after the installation;
=> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.

Read the analytics documentation (and how to opt-out) here:

No analytics data has been sent yet (or will be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:

==> Next steps:

  • Run brew help to get started

  • Further documentation:

MacBook-Pro-van-Gijs:~ gijslemaire$ brew docter

Traceback (most recent call last):

9: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `’

8: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative’

7: from /usr/local/Homebrew/Library/Homebrew/global.rb:112:in `<top (required)>’

6: from /usr/local/Homebrew/Library/Homebrew/global.rb:112:in `new’

5: from /usr/local/Homebrew/Library/Homebrew/PATH.rb:10:in `initialize’

4: from /usr/local/Homebrew/Library/Homebrew/PATH.rb:73:in `parse’

3: from /usr/local/Homebrew/Library/Homebrew/PATH.rb:73:in `flat_map’

2: from /usr/local/Homebrew/Library/Homebrew/PATH.rb:73:in `each’

1: from /usr/local/Homebrew/Library/Homebrew/PATH.rb:73:in `block in parse’

/usr/local/Homebrew/Library/Homebrew/PATH.rb:73:in `split’: invalid byte sequence in UTF-8 (ArgumentError)

Hi @AchelZuid,

Please run the following command line from your terminal:

locale && xxd -g 1 <<< "${PATH}"

and paste the output here.

Hi Claudia, this is what I get;

00000000: 2f 4c 69 62 72 61 72 79 2f 46 72 61 6d 65 77 6f /Library/Framewo
00000010: 72 6b 73 2f 50 79 74 68 6f 6e 2e 66 72 61 6d 65 rks/Python.frame
00000020: 77 6f 72 6b 2f 56 65 72 73 69 6f 6e 73 2f 33 2e work/Versions/3.
00000030: 37 2f 62 69 6e 3a 2f 4c 69 62 72 61 72 79 2f 46 7/bin:/Library/F
00000040: 72 61 6d 65 77 6f 72 6b 73 2f 50 79 74 68 6f 6e rameworks/Python
00000050: 2e 66 72 61 6d 65 77 6f 72 6b 2f 56 65 72 73 69 .framework/Versi
00000060: 6f 6e 73 2f 33 2e 37 2f 62 69 6e 3a 2f 75 73 72 ons/3.7/bin:/usr
00000070: 2f 6c 6f 63 61 6c 2f 62 69 6e 3a 2f 75 73 72 2f /local/bin:/usr/
00000080: 62 69 6e 3a 2f 62 69 6e 3a 2f 75 73 72 2f 73 62 bin:/bin:/usr/sb
00000090: 69 6e 3a 2f 73 62 69 6e 3a 2f 55 73 65 72 73 2f in:/sbin:/Users/
000000a0: 67 69 6a 73 6c 65 6d 61 69 72 65 2f 62 69 6e 3a gijslemaire/bin:
000000b0: e2 80 99 2f 75 73 72 2f 6c 6f 63 61 6c 2f 62 69 …/usr/local/bi
000000c0: 6e 3a 80 99 0a n:…

Thanks @AchelZuid!

You need to edit your PATH environment variable and remove the trailing garbage character, the one right next to the final :. Remove the trailing :, too.

Finally, there’s one more garbage character at the beginning of the final entry (between the : and the /); remove that, too.

Does that fix the issue?

Hi Claudia,

Thanks again for your reaction, I can not wait to try it but, and I feel like a boy going to school for the very first time, I have not a clue how to do this.
I start python and programming just a few weeks ago…
Hopefully you can give me some more info, I tried google but I could not find how to do it, not even what a “trailing garbage character” is.

Thanks in advance for your help

With kind regards

It’s the last character in your PATH declaration. It being garbage is not a technical term, it shouldn’t be there and it’s making a mess of your PATH. Don’t forget to remove the other indicated characters too.

1 Like

Dear Claudia and Sean,

It is working now, although I do not know what I did, can you recommend me a place where I can find material to study the PATH environment. I find it very
confusing and I really like to know more about it.

Thank you both for your response and help!!

1 Like this seems to be a pretty good writeup. Good to hear you fixed it. Good luck with your programming journey.

If you have ever installed software like Wireshark or some standalone dev tools from Apple, sometimes they have a step during their installation adding an entry in a directory /private/etc/paths.d and sometimes a documentation counterpart to /private/etc/manpaths.d that gets read in whenever a login shell is started. Usually they append a directory containing command line tools, maybe in their app bundle, to PATH.

Sometimes they are removed when the application is removed, sometimes they are just left in there.

I don’t know if, or how this can lead to extra delimiters being added to PATH, but it is one of the more common/standard ways the variable is altered.

1 Like