gpt4 book ai didi

ruby-on-rails - 使用 brew 时出现 "bad interpreter"错误

转载 作者:数据小太阳 更新时间:2023-10-29 06:27:45 25 4
gpt4 key购买 nike

当我尝试运行任何 brew 命令时出现此错误。

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

我完全不知道如何解决这个问题,并且搜索了很长时间都没有答案。

最佳答案

我遇到了这个错误(大致相同):

/usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory /usr/local/bin/brew: line 26: /usr/local/Library/brew.rb: Undefined error: 0

并通过以下解决方案修复:

  1. 打开 brew.rb :

    $ sudo vim /usr/local/Library/brew.rb
  2. 改变第一行的1.8Current :

    之前:

    #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0

    之后:

    #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0

然后 brew为我工作。如果其他人遇到此问题,希望它有所帮助。 :)


如果报错

Homebrew requires Leopard or higher. For Tiger support, see: https://github.com/mistydemeo/tigerbrew

<10.5 更改 MACOS 检查至 <10 .

来自@TimCastelijns 的提示:

10.5 doesn't work because in comparison, it's higher than 10.10 (.1 vs .5). I added a check (and MACOS_VERSION != 10.10) instead of lowering from 10.5 to 10.

关于ruby-on-rails - 使用 brew 时出现 "bad interpreter"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8864668/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com