massemanet / distel

emacs - erlang IDE
http://massemanet.github.io/distel/
MIT License
322 stars 73 forks source link

Could not make on Ubuntu, compilation error: "elisp/erl-test.el:3:1:Error: Cannot open load file: No such file or directory, erlang"" #70

Open zwpdbh opened 3 years ago

zwpdbh commented 3 years ago

Excuse me, I have git cloned the package from the master branch and save it to my ~/.emacs.d/site-lisp/.

Then, I cd into the folder and run make. The output shows:

emacs -batch -L elisp -f batch-byte-compile elisp/erl-test.el

In toplevel form:
elisp/erl-test.el:3:1:Error: Cannot open load file: No such file or directory, erlang
Makefile:64: recipe for target 'elisp/erl-test.elc' failed
make: *** [elisp/erl-test.elc] Error 1

But, erlang is already installed:

zw@DESKTOP-TTOPQ58:~/.emacs.d/site-lisp/distel$ erl
Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:10] [kernel-poll:false]

Eshell V9.2  (abort with ^G)
1>

zw@DESKTOP-TTOPQ58:~/.emacs.d/site-lisp/distel$ which erl
/usr/bin/erl

And my Emacs configuration is

(cond (*win64*
       (setq erlang-root-dir "c:/Program Files/erl-23.0/")
       (setq erlang-man-root-dir (concat erlang-root-dir "man"))
       (add-to-list 'exec-path (concat erlang-root-dir "bin/"))
       (add-to-list 'load-path (concat erlang-root-dir "lib/tools-3.4/emacs")))
      (t
       (setq erlang-root-dir "/usr/lib/erlang/")
       (setq erlang-man-root-dir (concat erlang-root-dir "man"))
       (add-to-list 'exec-path (concat erlang-root-dir "bin"))
       (add-to-list 'load-path (concat erlang-root-dir "lib/tools-2.11.1/emacs"))))

(when (executable-find "erl")
  (require 'erlang-start)

  (after-load 'erlang
    ;; ref: http://alexott.net/en/writings/emacs-devenv/EmacsErlang.html
    ;; Installation & customization of distel
    ;; for loading https://github.com/massemanet/distel
    (add-to-list 'load-path "~/.emacs.d/site-lisp/distel/elisp")
    (require 'distel)
    (distel-setup)))

Now, when I start up Emacs and edit any ".erl" file. I could see in modes:

Erlang-Extended minor mode (indicator EXT):
Extensions to erlang-mode for communicating with a running Erlang node.

Does this mean Distel's feature could work properly?

The message buffer shows no error, but the compilation buffer shows same error:

-*- mode: compilation; default-directory: "~/.emacs.d/site-lisp/distel/elisp/" -*-
Compilation started at Tue Apr 27 12:42:12

pwd && make -C.. all
/home/zw/.emacs.d/site-lisp/distel/elisp
make: Entering directory '/home/zw/.emacs.d/site-lisp/distel'
emacs -batch -L elisp -f batch-byte-compile elisp/erl-test.el

In toplevel form:
elisp/erl-test.el:3:1:Error: Cannot open load file: No such file or directory, erlang
Makefile:64: recipe for target 'elisp/erl-test.elc' failed
make: *** [elisp/erl-test.elc] Error 1
make: Leaving directory '/home/zw/.emacs.d/site-lisp/distel'

Compilation exited abnormally with code 2 at Tue Apr 27 12:42:12

How to fix this?

massemanet commented 3 years ago

You probably don't have erlang.el installed. It's available through the emacs package system (as is distel).

On Tue, Apr 27, 2021, 06:47 zwpdbh @.***> wrote:

Excuse me, I have git cloned the package from the master branch and save it to my ~/.emacs.d/site-lisp/.

Then, I cd into the folder and run make. The output shows:

emacs -batch -L elisp -f batch-byte-compile elisp/erl-test.el

In toplevel form: elisp/erl-test.el:3:1:Error: Cannot open load file: No such file or directory, erlang Makefile:64: recipe for target 'elisp/erl-test.elc' failed make: *** [elisp/erl-test.elc] Error 1

But, erlang is already installed:

zw@DESKTOP-TTOPQ58:~/.emacs.d/site-lisp/distel$ erl Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:10] [kernel-poll:false]

Eshell V9.2 (abort with ^G)1>

zw@DESKTOP-TTOPQ58:~/.emacs.d/site-lisp/distel$ which erl /usr/bin/erl

And my Emacs configuration is

(cond (win64 (setq erlang-root-dir "c:/Program Files/erl-23.0/") (setq erlang-man-root-dir (concat erlang-root-dir "man")) (add-to-list 'exec-path (concat erlang-root-dir "bin/")) (add-to-list 'load-path (concat erlang-root-dir "lib/tools-3.4/emacs"))) (t (setq erlang-root-dir "/usr/lib/erlang/") (setq erlang-man-root-dir (concat erlang-root-dir "man")) (add-to-list 'exec-path (concat erlang-root-dir "bin")) (add-to-list 'load-path (concat erlang-root-dir "lib/tools-2.11.1/emacs"))))

(when (executable-find "erl") (require 'erlang-start)

(after-load 'erlang ;; ref: http://alexott.net/en/writings/emacs-devenv/EmacsErlang.html ;; Installation & customization of distel ;; for loading https://github.com/massemanet/distel (add-to-list 'load-path "~/.emacs.d/site-lisp/distel/elisp") (require 'distel) (distel-setup)))

Now, when I start up Emacs and edit any ".erl" file. I could see in modes:

Erlang-Extended minor mode (indicator EXT): Extensions to erlang-mode for communicating with a running Erlang node.

Does this mean Distel's feature could work properly?

The message buffer shows no error, but the compilation buffer shows same error:

-- mode: compilation; default-directory: "~/.emacs.d/site-lisp/distel/elisp/" -- Compilation started at Tue Apr 27 12:42:12

pwd && make -C.. all /home/zw/.emacs.d/site-lisp/distel/elisp make: Entering directory '/home/zw/.emacs.d/site-lisp/distel' emacs -batch -L elisp -f batch-byte-compile elisp/erl-test.el

In toplevel form: elisp/erl-test.el:3:1:Error: Cannot open load file: No such file or directory, erlang Makefile:64: recipe for target 'elisp/erl-test.elc' failed make: *** [elisp/erl-test.elc] Error 1 make: Leaving directory '/home/zw/.emacs.d/site-lisp/distel'

Compilation exited abnormally with code 2 at Tue Apr 27 12:42:12

How to fix this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/massemanet/distel/issues/70, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADDBXHKWEDR6PBBTU4HX3TKY6W5ANCNFSM43UGUWOA .

DimaLapshyn commented 3 years ago

@massemanet I am getting the same error though I do have Erlang mode installed.

M-x erlang-version

gives me "Erlang mode version 2.8.4, written by Anders Lindgren"