Question

I am new to Emacs and I am having a bit of trouble. I am looking to run racket from Emacs using Geiser. I told Emacs where racket is as follows:

(setq geiser-racket-binary "/Applications/Racket\ v6.0/DrRacket.app")

(I took this from StackOverflow question: Setting Racket Geiser Emacs Path.)

I start by compiling the racket code that is saved. However, when I attempt to hit M-x followed by run-geiser, it then prompts me for a Scheme implementation. At this point I type racket. Emacs now opens a racket REPL buffer and in that buffer it leaves the error:

Can't exec program: /Applications/Racketv6.0/DrRacket.app .

If it helps, here is my .emacs file:

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.

 '(geiser-repl-startup-time 20000)
 '(package-archives (quote (("gnu" . "elpa gnu packages website") ("melpa" . "http://melpa.milkbox.net/#/"))))    
 '(package-directory-list (quote ("/Applications/Emacs.app/Contents/Resources/site-lisp/elpa")))    
 '(python-python-command "/usr/local/bin/python3"))

(setq geiser-racket-binary "/Applications/Racket\ v6.0/DrRacket.app")    
(setq-default cursor-type 'bar)

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :background "controlDarkShadowColor" :foreground "Green" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "apple" :family "Monaco")))))

(require 'package)

(add-to-list 'package-archives 
     '("marmalade" .
      "http://marmalade-repo.org/packages/"))
(package-initialize)
Was it helpful?

Solution

I think you are referencing the wrong executable.

"DrRacket" is an IDE (with a graphical user interface) for editing Racket code. From man drracket:

DrRacket is the Racket programming environment.

Try setting geiser-racket-binary to the location of the racket executable (which is the "core Racket implementation") instead.


EDIT

If the naming scheme of the Mac installation of Racket is anything like the one used for the Linux installation, there should be a binary called Racket or racket in a location similar to where you can find the DrRacket (or drracket) binary:

$ locate racket
...
/usr/bin/drracket
/usr/bin/gracket
/usr/bin/gracket-text
/usr/bin/racket
...

(Not suggesting that you will find the binaries in /usr/bin/, just trying to illustrate that there is a good chance all binaries that are possibly relevant are located in the same directory.)

OTHER TIPS

On OS X xxx.app is technically a directory. The actual executable file is located in Content/MacOS/xxx (if my memory serves me correctly).

EDIT: In other words, you should write something like:

(setq geiser-racket-binary "/Applications/Racket\ v6.0/DrRacket.app/Content/MacOS/DrRacket")

Note: I'n not at my Mac so I can't verify the details right now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top