家酿将不会安装任何东西,我也无法手动安装gradle

时间:2019-01-26 00:30:13

标签: gradle homebrew

我正在尝试安装gradle,以便可以在Java程序上使用build.gradle文件。应该可以使用简单的brew install gradle来完成此操作,但是会产生错误。

因此,我是手动安装的,但是每当我执行gradle -vgradle -version时,它都会显示-bash: gradle: command not found。因此,我的主要问题是如何修复自制程序,以便它可以为我实际安装东西,如果无法解决,那么手动安装在哪里出错了?(将gradle解压缩到正确的opt/gradle目录中之后,修改.bashrc等)

以下是自制安装和输出示例:

$ brew install gradle
/usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `split': invalid byte sequence in UTF-8 (ArgumentError)
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `block in parse'
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `each'
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `flat_map'
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:71:in `parse'
    from /usr/local/Homebrew/Library/Homebrew/PATH.rb:8:in `initialize'
    from /usr/local/Homebrew/Library/Homebrew/global.rb:106:in `new'
    from /usr/local/Homebrew/Library/Homebrew/global.rb:106:in `<top (required)>'
    from /usr/local/Homebrew/Library/Homebrew/brew.rb:17:in `require_relative'
    from /usr/local/Homebrew/Library/Homebrew/brew.rb:17:in `<main>'

当我键入gradle -vgradle -version时,我应该看到我确实有gradle,并且可以用它来构建Java项目。

1 个答案:

答案 0 :(得分:0)

您的自制软件安装似乎已损坏。尝试使用以下方法卸载它:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

并使用以下命令重新安装它:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"