I'm on Ubuntu (14.04) and just installed the latest version of GVM (1.3.13). I then used it to install Grails (2.3.7), Groovy (2.2.2) and Gradle (1.11).
Groovy and Gradle seem to have installed perfectly fine (I can execute their SDK commands, such as groovyc
, etc.). But whenever I execute any Grails command, from any directory, my entire terminal's screen clears, pauses for a second, and then re-draws my command line prompt. The command never gets executed. Several months ago, on Nabble, another user reported a very similar issue.
From the shell, if I execute echo $GRAILS_HOME
, I get:
/home/myuser/.gvm/grails/current
If I ececute echo $PATH
I do see that /home/myuser/.gvm/grails/current/bin
is on my system path.
So then I decided to dig deeper and actually go to $GRAILS_HOME
. It's a symbolic link actually pointing to /home/myuser/.gvm/grails/2.3.7
. So when I go there, I see a normal Grails installation, including a bin
directory. When I drop into that bin
dir, I see:
grails-debug
grails.bat
grails-debug.bat
startGrails.bat
startGrails
grails
I open grails
(a shell script) and see:
#!/bin/sh
trap "reset" EXIT
trap "reset" INT
trap "reset" TERM
DIRNAME=`dirname "$0"`
. "$DIRNAME/startGrails"
startGrails org.codehaus.groovy.grails.cli.GrailsScriptRunner "$@"
I modified this as follows:
#!/bin/sh
trap "reset" EXIT
trap "reset" INT
trap "reset" TERM
echo "1..."
sleep 2s
DIRNAME=`dirname "$0"`
echo "2...dirname is $DIRNAME"
sleep 8s
. "$DIRNAME/startGrails"
echo "3..."
sleep 2s
startGrails org.codehaus.groovy.grails.cli.GrailsScriptRunner "$@"
And then saved/exited and ran grails help
from the shell. Here was my output:
1...
2...dirname is /home/zharvey/.gvm/grails/current/bin
The last line of output ("2...dirname is...") pauses for 2 seconds, and then my screen clears (as if I had issued a clear
command) and my prompt re-appears. At no point in time does my actual command (grails help
) actually execute or generate output. So it seems that the exact line where the bug exists is:
. "$DIRNAME/startGrails"
What is this line even doing, and why would it cause the script to fail?
My questions
- Can someone confirm that this is in fact a Grails or GVM bug, and not a situation where I have installed something incorrectly?
- Most importantly, can someone tell me what I can do to fix this and get Grails up and running as fast as possible?