当我尝试运行此命令以使用GVM安装Groovy时,我收到以下错误消息:
$gvm install groovy
Stop! groovy is not a valid candidate.
Run Code Online (Sandbox Code Playgroud)
为什么这不起作用?据我所知,我使用这个正确安装了GVM:
$ curl -s get.gvmtool.net | bash
Run Code Online (Sandbox Code Playgroud)
我在Mac上
这是我跑步时看到的gvm help:
$ gvm help
Usage: gvm <command> <candidate> [version]
gvm offline <enable|disable>
commands:
install or i <candidate> [version]
uninstall or rm <candidate> <version>
list or ls <candidate>
use or u <candidate> [version]
default or d <candidate> [version]
current or c [candidate]
outdated or o [candidate]
version or v
broadcast or b
help or h
offline <enable|disable>
selfupdate [force]
flush <candidates|broadcast|archives|temp>
candidate :
version : where optional, defaults to latest stable if not provided
eg: gvm install groovy
Run Code Online (Sandbox Code Playgroud)
您的候选人名单遗失了.您可能有一个名为$ HOME/.gvm/var/candidates的空文件.尝试运行gvm flush候选者,然后打开一个新的终端,以便gvm初始化.这应该迫使gvm下载候选文件.