greghendershott / racket-mode

Emacs major and minor modes for Racket: edit, REPL, check-syntax, debug, profile, and more.

Home Page:https://www.racket-mode.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FAQ: "permission denied" when running your Racket program

greghendershott opened this issue · comments

  • When you use Racket as installed from https://snapcraft.io/racket, it runs using strict confinement.

    Among other restrictions, Racket won't be able to read from directories named starting with a dot -- for example: ~/.emacs.d/elpa.

    AND...

  • When you install Racket Mode as a normal Emacs package from MELPA, its files go under ~/.emacs.d/elpa.

    Therefore when Racket Mode starts its "back end", written in Racket, it does racket ~/.emacs.d/elpa/racket-mode-xxx/main.rkt. Ergo the permission error.

Ways to avoid this problem

To avoid the problem, avoid either of the above conditions:

  • Install Racket directly from https://download.racket-lang.org/. Racket's Linux installer is easy to use and flexible.

    (Facts: Distro packages of Racket tend to be very old versions. Although the snap package is newer, unfortunately it comes with strict confinement.

    Opinions: Sometimes it's best to get things direct, and, with freedom to use a programming language to write/use any program you wish... even a program that reads from certain directories. 😄)

    OR...

  • Install Racket Mode so its files are not under a dot directory. Any of the following can work:

    • Clone the files from here on GitHub, and add that directly to load-path in your Emacs init file.

      OR...

    • Move your entire elpa subdirectory from under ~/.emacs.d to somewhere else, like ~/emacs-packages, and add (setq package-user-dir "~/emacs-packages") early in your Emacs init file, before any other package-xxx expressions.