0

When attempting to save some file.gpg, the minibuffer returns Opening output file: Searching for program, no such file or directory, gpg. According to the EmacsWiki, all that should be required is the following two lines in ~/.emacs.d/init.el

(require 'epa-file)
(epa-file-enable) 

I am running Emacs 24.5.1 on Mac OS X 10.11.6. I installed gpg separately via terminal command brew install gpg, but this did not help. What am I missing?

ktolbol
  • 68
  • 4

1 Answers1

0

Looks like a common issue with environment variables in GUI version of emacs. To solve this you can install exec-path-from-shell package and add this to your init file:

(exec-path-from-shell-initialize)

or you can modify exec-path by adding required folder:

(setq exec-path (append exec-path '("/path/to/binary/folder/"))
Oles Savluk
  • 196
  • 3
  • 10
  • With the suggested package, encryption now seems to work, but decryption does not - attempting to reopen the file yields "Decrypting /path/to/file.gpg...done\n epa-file--find-file-not-found-function: Opening input file: Decryption failed". Any suggestions would be most welcome. – ktolbol Nov 01 '17 at 22:03
  • @ktolbol take a look at this answer - https://emacs.stackexchange.com/questions/27841/unable-to-decrypt-gpg-file-using-emacs-but-command-line-gpg-works – Oles Savluk Nov 02 '17 at 20:12
  • I tried those steps to no avail. I am also not convinced that the causes are the same, as in that answer, the error is "[...]Opening input file: Decryption failed, No secret key", whereas in my case, no further explanation is provided, the message simply ends at "Decryption failed, ". – ktolbol Nov 02 '17 at 21:00
  • Not sure why it is. Do you able to decrypt this file using gpg from terminal? – Oles Savluk Nov 02 '17 at 22:22
  • Strangely, it is working now from Emacs as well. Thanks a lot! – ktolbol Nov 03 '17 at 19:36