Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need help installing PLT Racket, I moved the Racket folder into Applications but I don't know how to use the raco command in the terminal

Tags:

racket

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.

like image 889
TheVerv Avatar asked Jan 28 '12 17:01

TheVerv


2 Answers

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.

like image 177
dyoo Avatar answered Dec 30 '22 13:12

dyoo


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).

like image 23
Scott Hunter Avatar answered Dec 30 '22 11:12

Scott Hunter