Wie installiere ich Grails?(Environment Variablen setzen)

D

dragi

Aktives Mitglied
Thread Starter
Dabei seit
09.11.2003
Beiträge
100
Reaktionspunkte
1
Hallo,

ich möchte mich ein wenig mit Grails beschäftigen. Nun steht folgendes in der Installationsanleitung:

-Download the latest Grails release

-Extract the archive into an appropriate location

-Create a GRAILS_HOME environment variable that points to the path where you extracted the archive (eg C:\grails on Windows or ~/grails on Unix)

-Append a reference to the "bin" directory within the Grails directory to your PATH variable (eg %GRAILS_HOME%\bin on Windows or $GRAILS_HOME/bin on Unix)

-Type "grails" at the command line, if a help message is displayed you are ready to start using Grails!

Meine Frage:

Wie erstelle ich eine Environment Variable und wie setze ich die Referenz? Ist mir jetzt schon ein wenig peinlich ...aber ich nutze erst seit ein paar Wochen OSX ;)

Danke

Dragi
 
Eine Environment Variable kann man auf verschiedene Art setzen und sie wirkt auch jeweils auf verschiedenen Ebenen.
Für Deinen Zweck dürfte es zunächst einmal genügen eine temporäre Variable in der Shell zu setzen. Ich gehe mal davon aus, dass Du ein System neuer OS X 10.2 hast und dass Dein Verzeichnis grails in Deinem Benutzerordner (im Häuschen) liegt.Du gibst dann im Terminal folgendes ein:
Code:
export GRAILS_HOME=~/grails
export PATH=$PATH:$GRAILS_HOME/bin
rehash
Das war's dann auch schon; wirkt allerdings erst einmal nur bis Du das Terminalfenster wieder zu machst.
 
Hallo,

danke für die Antwort. Da ich zur zeit arbeiten bin, konnte ich das noch nicht ausprobieren.
Aber wie mache ich es denn, das die Einstellungen für immer gelten und nicht bis ich mein terminal schliesse? Ich möchte das ja nciht jedesmal neu eingeben müssen?!

Vielen Dank

Dragi
 
Zu dieser Frage empfehle ich mal in aller Bescheidenheit einen Artikel auf meiner Website:
http://www.chaos-net.de/shell-2.html
Schreib die selben Kommandos einfach in eine passende Datei. Das "rehash" kannst Du in diesem Fall weglassen.
 
Ich habe nun erstmal die erste, von dir vorgeschlagene, Lösung versucht. Aber meine bash kennt den Befehl rehash nicht?! Und grail ist dann aus diesem Grund auch ein unbekanntes Kommando.

Noch eine Idee wie ich das ans laufen bekomme?

Gruß

Dragi
 
Okay; war ne Verwechslung von mir.
rehash ist ein zsh built-in command.

Was sagt Dir das folgende Kommando, nachdem Du die Änderungen vorgneommen hast?
Code:
echo $PATH
 
Zuletzt bearbeitet:
So, jetzt hab ich es nochmal probiert und echo $Path gibt folgndes aus:
Code:
OSIRIS:~ thomaswickl$ echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/bin:/Users/thomaswickl/coding/grails/bin

und das Kommando grails sagt permission denied:
Code:
OSIRIS:~ thomaswickl$ grails
-bash: /Users/thomaswickl/coding/grails/bin/grails: Permission denied
Aber ich habe eigentlich admin rechte....denke ich?!

Gruß

Dragi
 
Na also. Die PATH Variabla stimmt schon mal.
Das andere bekommen wir auch noch hin.

Bitte poste die Ausgabe der folgenden Kommandos:
Code:
ls -ld /Users/thomaswickl/coding/
ls -ld /Users/thomaswickl/coding/grails/
ls -ld /Users/thomaswickl/coding/grails/bin
ls -l /Users/thomaswickl/coding/grails/bin/grails
Dann seh'n wir was los ist. Alles andere wäre Spekulation.
 
Hi,

hier die gewünschten Ausgaben:

Code:
OSIRIS:~ thomaswickl$ ls -ld /Users/thomaswickl/coding/
drwxr-xr-x   15 thomaswi  thomaswi  510 Mar 31 01:01 /Users/thomaswickl/coding/
Code:
OSIRIS:~ thomaswickl$ ls -ld /Users/thomaswickl/coding/grails/
drwxr-xr-x   16 thomaswi  thomaswi  544 Feb 22 12:44 /Users/thomaswickl/coding/grails/
Code:
OSIRIS:~ thomaswickl$ ls -ld /Users/thomaswickl/coding/grails/bin
drwxr-xr-x   7 thomaswi  thomaswi  238 Mar 29 21:51 /Users/thomaswickl/coding/grails/bin
Code:
OSIRIS:~ thomaswickl$ ls -ld /Users/thomaswickl/coding/grails/bin/grails
-rw-r--r--   1 thomaswi  thomaswi  127 Feb 22 12:43 /Users/thomaswickl/coding/grails/bin/grails

Und vielen Dank das du dir die Mühe machst

dragi
 
Code:
chmod +x /Users/thomaswickl/coding/grails/bin/grails
sollte das Problem beheben.
 
Juhuuu!!!!
Es funktioniert jetzt :)

Vielen vielen Dank

Dragi
 
Zurück
Oben Unten