我正在尝试安装gradle,以便可以在Java程序上使用build.gradle
文件。应该可以使用简单的brew install gradle
来完成此操作,但是会产生错误。
因此,我是手动安装的,但是每当我执行gradle -v
或gradle -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 -v
或gradle -version
时,我应该看到我确实有gradle,并且可以用它来构建Java项目。
答案 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)"