尝试安装自制程序时出现未定义的方法"<"错误

Jos*_*ern 9 homebrew nomethoderror

所以我试图在我的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$
Run Code Online (Sandbox Code Playgroud)

我还彻底研究了"通过sudo以root身份重新运行"这一行并没有用,所以我假设问题在于我一直看到的NoMethodError.任何帮助都将非常感谢!

小智 24

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