Getting a “bad interpreter” error when using brew

2019-01-09 02:42发布

I'm getting this error when I try to run any brew command.

Holger-Sindbaeks-MacBook-Air:~ holgersindbaek$ brew help
-bash: /usr/local/bin/brew: /usr/bin/ruby: bad interpreter: No such file or directory

I have absolutely no idea on how to fix this and been searching for a long time without answer.

8条回答
疯言疯语
2楼-- · 2019-01-09 03:30

None of the above worked for me, so I kept browsing and found this answer, https://stackoverflow.com/a/24225960/1359088 which did fix brew for me. He says in step 1 to install XCode 6 command line tools, but doesn't say how; use this command:

xcode-select --install
查看更多
做自己的国王
3楼-- · 2019-01-09 03:41

After upgrading to macOS High Sierra, get it fixed with following commands:

sudo gem install cocoapods

查看更多
登录 后发表回答