astoff / digestif

A language server for TeX and friends
Other
251 stars 6 forks source link

/home/user/.digestif/bin/digestif:2: in main chunk #31

Closed liar666 closed 2 years ago

liar666 commented 3 years ago

Hi,

I'm trying to run digestif so that I can get LSP under Emacs on my OpenBSD box.

When I go to ~/.digestif and run ./bin/digestif, nothing happens, but the program does not end, which seems good to me for a (language)-server.

However, when I open a .tex file in Emacs and do M-x lsp it tells me lsp server did not run correctly and buffer digestif::stderr says:

stack traceback:
    [C]: in function 'require'
    /home/user/.digestif/bin/digestif:2: in main chunk
    [C]: in ?

Process digestif stderr<1> finished

Process digestif stderr finished

Do do not know anything about lua and this message does not help me much.

Any idea?

NOTE: I apparently have lua51 and lua53 installed

EDIT: running ./bin/digestif -v gives me 22:02:12 Digestif started! so everything seems OK outside Emacs.

astoff commented 3 years ago

Which installation method did you use? What happens if you run digestif -v in the home directory without specifying a path (that's what Emacs will do)?

RaulPPelaez commented 3 years ago

Hi, I get similar errors, I installed using the script provided in the README.md. This is the output of running digestif -v

lua: /home/user/.digestif/bin/digestif:2: module 'digestif.langserver' not found:
    no field package.preload['digestif.langserver']
    no file '/usr/share/lua/5.4/digestif/langserver.lua'
    no file '/usr/share/lua/5.4/digestif/langserver/init.lua'
    no file '/usr/lib64/lua/5.4/digestif/langserver.lua'
    no file '/usr/lib64/lua/5.4/digestif/langserver/init.lua'
    no file './digestif/langserver.lua'
    no file './digestif/langserver/init.lua'
    no file '/usr/lib64/lua/5.4/digestif/langserver.so'
    no file '/usr/lib64/lua/5.4/loadall.so'
    no file './digestif/langserver.so'
    no file '/usr/lib64/lua/5.4/digestif.so'
    no file '/usr/lib64/lua/5.4/loadall.so'
    no file './digestif.so'
stack traceback:
    [C]: in function 'require'
    /home/user/.digestif/bin/digestif:2: in main chunk
    [C]: in ?

I tried using luarocks, but the installation fails because of an unmet dependency (dkjson). I am in Fedora 33, which ships with lua 5.4.

If I change lua by texlua here the server runs, but only if I launch it from the $HOME/.digestif/ directory. Running it outside this folder gets me the same error above.

Finally, setting the LUA_PATH variable to this (in addition to the aforementioned change to .digestif/bin/digestif): $ export LUA_PATH=/home/user/.digestif/?.lua

Makes the server run without apparent issues.

astoff commented 3 years ago

@RaulPPelaez Are you sure you are calling the bash script, and not the bin/digestif Lua script directly? You can check this by typing which digestif in a terminal.

astoff commented 2 years ago

Since there was no reply in a several months, I'll close this.

yugaego commented 2 years ago

digestif:2: module 'digestif.langserver' not found:

I had the same error having lua installed and apparently wrongly relying on digestif from source directly.

The issue was fixed in my case by installing luarocks, and then using digestif installed by luarocks.

Though I'm sure the already mentioned bash script approach should work too.

astoff commented 2 years ago

Just to make sure: if you follow the i, ii, iii steps in the "For LuaTeX with the self-installing script" section of the README, it just works, no?