【问题标题】:Undefined method `<' error when attempting to install homebrew尝试安装自制软件时出现未定义的方法“<”错误
【发布时间】:2013-10-08 03:22:07
【问题描述】:

所以我试图在我的 Macbook Pro 上安装自制软件,以便能够运行 NINJA-IDE,每次执行网站上给出的代码时,我都会得到以下信息:

Joshs-MacBook-Pro:~ joshua$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/share
==> The following directories will have their group set to admin:
/usr/local/share

Press ENTER to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/share
Password:
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/share
==> Downloading and Installing Homebrew...


Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.


-e:84:in `git': undefined method `<' for nil:NilClass (NoMethodError)
    from -e:153:in `block in <main>'
    from -e:152:in `chdir'
    from -e:152:in `<main>'
Joshs-MacBook-Pro:~ joshua$

我还彻底研究了“通过 sudo 以 root 身份重新运行”这一行,但无济于事,所以我假设问题出在我一直看到的 NoMethodError 上。对此的任何帮助将不胜感激!

【问题讨论】:

    标签: homebrew nomethoderror


    【解决方案1】:

    如果您还没有,请通过 App Store 安装 XCode。然后运行它,并通过 GUI 接受许可证。现在再次运行 Homebrew 安装脚本。这解决了我的问题。

    【讨论】:

      【解决方案2】:

      刚刚安装了新的 XCode,从未打开过。事实证明,在使用 Homebrew 脚本之前,您必须同意许可。自行运行 XCode 并同意可以解决您的问题的许可。

      【讨论】:

      • 这也可以在终端中通过运行以下命令行来完成:sudo xcrun cc
      • @Etienne Neat!谢谢!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-05
      • 2023-02-01
      • 1970-01-01
      相关资源
      最近更新 更多