To explain, I have OSX and I wanted to install PLT Racket. I don't know how to use the raco command to run .rkt files in the terminal instead of using the Dr. Racket interpreter. I don't really like the DrRacket text editor.
Where do I put the bin, lib, and other folders? I can't seem to access the raco command at all or any of the other commands in the Racket bin.
Don't move subcomponents around. This potentially breaks Racket, which expects the bin directory to be in a certain place relative to its libraries.
Instead: add the Racket bin directory to your PATH. See Set environment variables on Mac OS X Lion or Setting environment variables in OS X? for more details on setting up environment variables in Mac OS X.
For example, I personally have Racket 5.2 under "/Applications/Racket v5.2/". I have a ~/.profile with the following contents:
mithril:~ dyoo$ cat .profile
## Adding Racket 5.2 to my PATH
export PATH=/Applications/Racket\ v5.2/bin:$PATH
## .. other contents omitted
After a re-login, I can see Racket from the Terminal:
mithril:~ dyoo$ which racket
/Applications/Racket v5.2/bin/racket
I have one additional file, the ~/.MacOSX/environment.plist, whose contents define more environment variables for graphical programs. Mine has the following contents:
mithril:~ dyoo$ cat .MacOSX/environment.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>MANPATH</key>
<string>/usr/local/man:/usr/share/man:/usr/local/share/man:/usr/X11/man</string>
<key>PATH</key>
<string>/Users/dyoo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/Applications/Racket\ v5.2/bin</string>
</dict>
</plist>
Having this file lets me run Racket from graphical programs that don't inherit their environment from the .profile login file.
You can just cd into the Racket/bin directory and execute it from there (you might need to specify ./raco if . isn't in your path). Or you could specify the full path to raco (can't help you w/ that as I don't know where you installed it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With