0

For some reason emacs is not able to find my ghci. I am running Ubuntu 16.04, and followed the instructions in this tutorial to the book.

Using which ghci I get the path /opt/ghc/7.10.3/bin/ghci. And executing M-: exec-path and M-: (getenv "PATH") I can see that path correctly printed.

I have tried to explicitly set the PATH variable in emacs like this, which changes nothing since as far as I could tell it was already there. From this answer.

(setenv "PATH" "/usr/local/bin:/usr/bin:/bin:/opt/cabal/1.22/bin/cabal:/opt/ghc/7.10.3/bin/ghci")
(setq exec-path (split-string (getenv "PATH") path-separator)

The same thing happens when I use (custom-set-variables '(haskell-process-type 'cabal-repl)) namely the error: "Searching for program: no such file or directory, cabal"

I would greatly appreciate help. :) I have no idea what to do, and I haven't found any answers on the internet.

Community
  • 1
  • 1
JasoonS
  • 1,432
  • 3
  • 13
  • 26

1 Answers1

1

The issue was that I was adding the path to the actual executable, rather than the folder in which the executable sits.

So: /opt/cabal/1.22/bin/cabal should be /opt/cabal/1.22/bin/

and: /opt/ghc/7.10.3/bin/ghci should be /opt/ghc/7.10.3/bin/

JasoonS
  • 1,432
  • 3
  • 13
  • 26
  • 1
    Worse happened to me, I had the actual `.../bin` folder but didn't add the trailing slash at the end, should be `.../bin/` – Seraf Jul 16 '22 at 22:16