0

I feel quit stupid asking this, but I am completely unable to set an environment variable in Mac OSX 10.8.

I'd greatly appreciate some specific instructions on which files to edit, what is the syntax to place in the file, etc.

I am trying to do some web development using Arc, which requires racket. I am getting an error from arc that 'racket' isn't a recognized command. I am only able to run racket commands when I am in Racket's bin directory (here is the location of my racket directory - /Applications/Racket v5.3.3/), which suggests to me that an environment variable has not yet been created for racket (but I could be wrong).

Thanks in advance.

GoZoner
  • 67,920
  • 20
  • 95
  • 145
Joe Waltman
  • 29
  • 1
  • 2
  • OK....I have added the following line to my .bash_profile file - "export PATH=$PATH:/Applications/Racket/bin" (without the quotes). Also, I shortened the Racket directory to just 'Racket' to remove the whitespace. Using the 'set' command, I've confirmed that the Path variable seems to be correctly set (here is the path line in the set out put - PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/Racket/bin). However, I am still unable to run ./racket from any directory but Racket's bin directory....any help would be greatly appreciated. – Joe Waltman Apr 07 '13 at 02:54

2 Answers2

2

Have you tried editing your profile? If you are using bash, edit the .bash_profile file in your home dir. You will have to insert a line like this:

export PATH="$PATH:/Applications/Racket\ v5.3.3"

Daniel
  • 21
  • 1
2

You have to add the path to Racket's bin/ directory to the PATH environment variable. Open the file ~/.bash_profile using your text editor of choice, look for a line that looks similar to this (the <paths> part is just a placeholder for the real paths) , if it doesn't exist, just add it:

PATH=$PATH:<paths>

At the end, add a : and the path to Racket's bin/ directory, something like this:

PATH=$PATH:<paths>:/Applications/Racket\ v5.3.3/bin

Replace the v5.3.3 version number with the appropriate version of your installation. Finally, make sure that this line appears somewhere in the file:

export PATH

Save it, and you're ready to go!

Óscar López
  • 232,561
  • 37
  • 312
  • 386
  • Thanks....I've made this change and it still doesn't work. For what it is worth, when I navigate to the Racket bin directory (which is at /Applications/Racket v5.3.3/bin/), I am able to run the ./racket command. However, when I attempt to run this from any other directory, no luck. – Joe Waltman Apr 07 '13 at 02:10
  • Also, I can see (via set) that the environment variables seem to be working....here is what is shown for me - PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/Racket/bin – Joe Waltman Apr 07 '13 at 02:29
  • Did you verify that the `export` part is correct? Also try closing the terminal and opening it again – Óscar López Apr 07 '13 at 05:09