Alec Wilson
Alec Wilson

Reputation: 566

command not found: grails, but path & installation is correct

I had grails installed and running correctly several days ago, but I came back from a vacation and am now getting the message command not found: grails. I searched, and all the results dealt with $PATH and $GRAILS_HOME, which are set up correctly, as far as I can tell. I set them up when I installed grails and had it working, I have made no changes to them.

here is my how I have my environment variables configured in my dotfiles:

export GRAILS_HOME="~/grails"
export PATH="$PATH:$GRAILS_HOME/bin"

$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home

Note: I installed version 2.5.1 using these instructions

UPDATE: I tried running the grails script inside the bin folder, and it ran correctly. However, I still cannot get the command grails to run from the command line.

Upvotes: 0

Views: 7627

Answers (4)

Ioann Alexaraki
Ioann Alexaraki

Reputation: 11

This is most probably resolved by now however for whoever is looking this problem up, maybe needless to say but make sure you don't spell any capital letters, such as Grails (misspelled) as it is case sensitive.

Upvotes: 1

Rodrigo Oliveira
Rodrigo Oliveira

Reputation: 1582

It probably is the ~ character that is not being interpreted as your home directory. Just use $HOME instead:

export GRAILS_HOME="$HOME/grails"
export PATH="$PATH:$GRAILS_HOME/bin"

Upvotes: 0

Alec Wilson
Alec Wilson

Reputation: 566

I found a workaround, but one that I am almost embarrassed to resort to. I realized that simply running the grails script from grails/bin worked, so I aliased grails as:

alias grails="~/grails/bin/grails"

I assume this is a pretty suboptimal solution, but it's working for now.

Upvotes: 0

Jeff Scott Brown
Jeff Scott Brown

Reputation: 27245

Pointing GRAILS_HOME to ~/.grails won't work. You need to point GRAILS_HOME to wherever you have Grails installed. ~/.grails/ is where Grails stores a number of things, not where the installation is.

Upvotes: 1

Related Questions