2

I am using grails installation on mac os x v.10.9.5. I used to have grails 2.4.2 installation and it was working fine. As I tried to install 2.4.3 version (both through gvm and manually, by unpacking archive and setting PATH and GRAILS_HOME variables), the installation seems to be ok, but when running "grails" command from terminal it had no effect, just the behaviour similar to "clear" terminal command. No output or error message was provided.

Does anyone have ideas what could be wrong with environment or installation? Or at least where can I find logs from running "grails" command?

Any help is appreciated. Thank you

mp_loki
  • 1,018
  • 1
  • 10
  • 21
  • If you switch back to 2.4.2 with gvm does everthing work? If so try unintalling and reinstalling 2.4.3 in gvm – Jeff Beck Oct 20 '14 at 21:38
  • I have 2.4.3 working on mac osx myself – Jeff Beck Oct 20 '14 at 21:38
  • What does `which grails` do for you? – Jeff Scott Brown Oct 21 '14 at 13:16
  • @JeffScottBrown, `which grails` points to gvm grails installation: `admin$ which grails /Users/admin/.gvm/grails/current/bin/grails`. @JeffBeck, yes, old 2.4.2 installation works (it was not a gvm installation). Reinstalling 2.4.3 in gvm, as well as reinstalling gvm did not have any effect. – mp_loki Oct 21 '14 at 17:48
  • It doesn't make sense that the `grails` command would behave like the `clear` command. If I had the system in front of me it would be a 15 second mission to fix it but without that it is hard to say what is going wrong. I am sorry that I can't help. – Jeff Scott Brown Oct 21 '14 at 19:41
  • Try installing grails using the gvmtool http://gvmtool.net/ , its the only way to fly! – Steve Oct 21 '14 at 23:18

2 Answers2

5

Find your grails installation, then check its shell wrapper at bin/grails. Suppose it contains the following lines :

#!/bin/sh
trap "reset" EXIT
trap "reset" INT
trap "reset" TERM

DIRNAME=`dirname "$0"`
. "$DIRNAME/startGrails"

startGrails org.codehaus.groovy.grails.cli.GrailsScriptRunner "$@"

Use your favourite text editor to edit the file, add # in front of the traps to comment those lines out.

#trap "reset" EXIT
#trap "reset" INT
#trap "reset" TERM

Then execute any grails commands like grails -version, check the console output to find the real reason that grails did not run. Good luck.

jeffrey
  • 238
  • 7
  • 15
  • Thanks! It's almost impossible to troubleshoot without actually seeing what is going wrong. – Joel Jun 21 '16 at 23:54
1

I had the same issue and in my case the error was due to $JAVA_HOME environment variable. For grails to execute properly java is a prerequisite. Therefore you should check whether you have added java to your class path before executing grails.

To verify this you should run, java -version before grails commands such as grails -version

dammina
  • 655
  • 1
  • 8
  • 23