6

When I try to run this command to install Groovy using GVM I get this error message:

$gvm install groovy
Stop! groovy is not a valid candidate.

Why doesn't this work? As far as I know I installed GVM correctly using this:

$ curl -s get.gvmtool.net | bash

I am on a Mac

Here is what I see when I run 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
adao7000
  • 3,632
  • 2
  • 28
  • 37
  • 1
    Working fine for me; you have a Java installed and functional? You opened a new window or ran the shell command, I assume, since you said you ran `gvm help` successfully? – Dave Newton Jun 19 '15 at 17:38
  • Yes, I have Java installed and functional. Yes, I tried both opening a new window and running the shell command. Here, I'll update with what I see when I run 'gvm help' – adao7000 Jun 19 '15 at 17:40
  • 1
    Any messages during `gvm` installation? Behind a proxy? Can you hit http://api.gvmtool.net, like http://api.gvmtool.net/candidates? – Dave Newton Jun 19 '15 at 17:46
  • Ah.. I don't remember. Could the problem have anything to do with having the Groovy plugin with IntelliJ 14? I wanted to run Groovy JUnit tests, but it said I had to select the Groovy SDK location, which is why I tried installing it. Am I doing this process wrong? – adao7000 Jun 19 '15 at 17:49
  • Yes, I can access those webpages. – adao7000 Jun 19 '15 at 17:50
  • 2
    I seriously doubt it's IntelliJ-related; `gvm` is its own tool, with its own directory (`$HOME/.gvm`), etc. I'd probably blow away that directory and try again as a sanity check. – Dave Newton Jun 19 '15 at 17:50
  • try to type `gvm current` and give us the output please – bmscomp Jul 06 '15 at 12:26
  • Just my 2 cents. I tried to reproduce it but could not. I have brew and bash updated to 4.3 but I tried also with old mac bash 3.2 and it worked. For some reason you have candidate list not populated. in gvm help you must have something like: candidate : asciidoctorj, crash, gaiden, glide, gradle, grails, griffon, groovy, groovyserv, jbake, jbossforge, lazybones, springboot, vertx version : where optional, defaults to latest stable if not provided ... but you have candidate: You may try to delete .gvm folder and reinstall it ... if this help – Hristo Trendafilov Jul 23 '15 at 17:14

1 Answers1

7

Your list of candidates is missing. You may have an empty file named $HOME/.gvm/var/candidates. Try running gvm flush candidates and then open a new terminal so that gvm initializes. That should force gvm to download the candidates file.

Emmanuel Rosa
  • 9,697
  • 2
  • 14
  • 20