Question

I'm trying to get Grails 2.2.1 up and running.

I have GVM, so I tried gvm install grails 2.2.1, it seems to have succeeded. I run the source command it tells me to and then grails --version and I see Grails version: 2.1.1.

Wat.

If I look in my user's .gvm/grails directory, and look at what the current symlink is pointing to, I see /home/myuser/.gvm/grails/2.2.1. If I do a which grails, I get /home/myuser/.gvm/grails/current/bin/grails.

If I go to /home/myuser/.gvm/grails/current/bin/grails and run ./grails --version I get Grails version: 2.2.1.

Does Grails 2.2.1 rely on Grails 2.1.1 in some way that would force GVM to also install it?

How do I correct my path so that when I run grails, it gives me the 2.2.1 version?

Was it helpful?

Solution

Did you manually install Grails 2.1.1 at some point?

The ~/.gvm/bin/gvm-init.sh script is normally sourced in .bashrc and configures the environment.

Verify the GVM environment is sourced properly in bashrc:

$ echo $GVM_AVAILABLE
true

Verify the GRAILS_HOME environment variable:

$ echo $GRAILS_HOME
~/.gvm/grails/current

Make sure there is no alias defined for grails:

$ alias grails
-bash: alias: grails: not found

Check the path order:

$ echo $PATH | awk 'BEGIN { RS=":" } { print NR, $0 }'

Verify the grails link:

$ ls -l ~/.gvm/grails/current
lrwxlrwxlrwx 1 user user 35 Feb 19 11:01 ~/.gvm/grails/current -> ~/.gvm/grails/2.2.1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top