When I enter brew doctor
(or any brew
command) in my terminal, I get this as a response:
-bash: /usr/local/bin/brew: /bin/sh^M: bad interpreter: No such file or directory
I have seen the ^M
response before and I think it has to do with dos line ending files. Is there a way to fix this?
I don't know how carriage returns ended up in your brew file, but you can remove them using
dos2unix
or by piping it throughtr -d '\r'
.Example:
Once verified, you can use
to replace the old one.
This worked for me:
vi /usr/local/bin/brew
):set fileformat=unix
:wq!
The brew command should be OK now.
Regards.