p00f / cphelper.nvim

Neovim helper for competitive programming. Use https://sr.ht/~p00f/cphelper.nvim instead
MIT License
130 stars 9 forks source link

Again 'http.server' not found #10

Closed anurag3301 closed 3 years ago

anurag3301 commented 3 years ago

image

I have already installed lua51 on my arch and ran following

sudo luarocks install http --lua-version 5.1
sudo luarocks install http

Here you can see, no error

image

image

:version from nvim

image

anurag3301 commented 3 years ago

Output of luarocks list

image

p00f commented 3 years ago

Huh the error says it is searching for the module in lua 5.1, why doesnt it work

anurag3301 commented 3 years ago

Done installed lua52 and http with version 5.2. and the repl doesn't give any error image

anurag3301 commented 3 years ago

Huh the error says it is searching for the module in lua 5.1, why doesnt it work

Maybe this is a PATH issue. I have given output of luarocks list

anurag3301 commented 3 years ago

You can see in the error output. None of them mentioned /usr/lib/luarocks or /home/anurag/.luarocks

anurag3301 commented 3 years ago

output of luarocks list --lua-version 5.1 image

p00f commented 3 years ago

You use packer.nvim right?

anurag3301 commented 3 years ago

yeppp, you can check my config if you want, github

p00f commented 3 years ago

You don't need to manually install anything then, the line is all you need:

https://github.com/anurag3301/my-linux-setup/blob/b866d5ac04b1e98c296fbdf385567d4d7b11fe72/config/nvim/lua/plugins.lua#L4

anurag3301 commented 3 years ago

I removed that line, Ran PackerUpdate. but no change

anurag3301 commented 3 years ago

Can I do a hacky fix, like taking the lib files and placing them where it is expecting them?

p00f commented 3 years ago

You can try I guess? Like nothing can go wrong if you place them in the /home/anurag/... locations

image

anurag3301 commented 3 years ago

Oh man, finally it's working. This hacky fix worked.

Tho for anyone in future face the same, this is what I did All the lib files installed by luarock was stored in this path: /usr/share/lua/5.1 But nvim's lua was looking for those lib files in the above-mentioned paths. So I just picked on and placed all my lib files there. I chose /usr/local/share/lua/5.1. Just run

sudo mkdir -p /usr/local/share/lua/5.1
sudo cp -r /usr/share/lua/5.1/*  /usr/local/share/lua/5.1/

But it was not done yet, It needed some more lib files like _cqueues.so and lpeg.so. And these lib files were stored in /usr/lib/lua/5.1 and one of the expected place for libs is /usr/local/lib/lua/5.1/ So I just ran

sudo mkdir -p /usr/local/lib/lua/5.1/
sudo cp -r /usr/lib/lua/5.1/*   /usr/local/lib/lua/5.1/

Now everything is working.

p00f commented 3 years ago

Arch users can install lua51-http instead of messing around In any case, I'll try to find a luarock-dependency-free solution.

p00f commented 3 years ago

I'll do it when https://github.com/neovim/neovim/pull/14871 is merged