rest.nvim icon indicating copy to clipboard operation
rest.nvim copied to clipboard

Issue with finding lib-curl

Open MrMic opened this issue 1 year ago • 7 comments

Hi,

Trying to make it works with AstroNvim and got this:

[rest.nvim] ERROR: lua-curl could not be found, therefore the cURL client will not work.

I got luarocks and got this:

` ❯ luarocks show lua-curl

Lua-cURL 0.3.13-1 - Lua binding to libcurl

License: MIT/X11 Homepage: https://github.com/Lua-cURL Installed in: /home/mic/.luarocks

Modules: cURL (/home/mic/.luarocks/share/lua/5.1/cURL.lua) cURL.impl.cURL (/home/mic/.luarocks/share/lua/5.1/cURL/impl/cURL.lua) cURL.safe (/home/mic/.luarocks/share/lua/5.1/cURL/safe.lua) cURL.utils (/home/mic/.luarocks/share/lua/5.1/cURL/utils.lua) lcurl (/home/mic/.luarocks/lib/lua/5.1/lcurl.so)

Depends on: lua >= 5.1, < 5.5 (using 5.1-1) `

Any any? It is useless in that state... :disappointed:

Rgds,

MrMic avatar Apr 19 '24 19:04 MrMic

Hi,

How did you install rest.nvim dependencies? Also please send :checkhealth rest-nvim output

NTBBloodbath avatar Apr 19 '24 19:04 NTBBloodbath

============================================================================== rest-nvim: require("rest-nvim.health").check()

Installation ~

  • OK Found luarocks installed in your system
  • OK Found Luarocks PATHs in your Neovim's Lua package.path
  • OK Dependency mimetypes was found
  • OK Dependency nvim-treesitter was found
  • OK Dependency nvim-nio was found
  • OK Dependency lua-curl was found
  • OK Dependency xml2lua was found
  • OK Tree-sitter http parser is installed

Configuration ~

  • OK No unrecognized configuration options were found
  • OK Formatter for json is set to jq and rest.nvim found it in your system
  • OK Formatter for html is set to tidy and rest.nvim found it in your system

Rgds,

MrMic avatar Apr 19 '24 19:04 MrMic

Is your Lua package.cpath also configured for luarocks paths? It's the only explanation I see for why the bookstore can't be found, I should also document that in the checkhealth.

NTBBloodbath avatar Apr 19 '24 19:04 NTBBloodbath

idk What is package.cpath ? Where do I find it?

MrMic avatar Apr 19 '24 19:04 MrMic

What is package.cpath ?

Take a look at the package.cpath section in the Lua 5.1 manual :)

Where do I find it?

You could use luarocks path to find the LUA_CPATH environment variable from luarocks. The relevant information would be the last two values, here's an example from my luarocks installation (I'm using rocks.nvim so my luarocks paths are a bit different)

/home/amartin/.luarocks/lib/lua/5.1/?.so;/home/amartin/.local/share/nvim/rocks/lib/lua/5.1/?.so

Add something like this to your init.lua so Neovim will be able to find the shared libraries installed through luarocks (remember to replace PATHs with yours!):

package.cpath = package.cpath .. ";" .. "/home/amartin/.luarocks/lib/lua/5.1/?.so;/home/amartin/.local/share/nvim/rocks/lib/lua/5.1/?.so"

NTBBloodbath avatar Apr 20 '24 00:04 NTBBloodbath

Done in my init.lua as you requested it but got the issue... Nonetheless I indeed got: ` ❯ ll .luarocks/lib/lua/5.1/lcurl.so

Permissions Size User Date Modified Name

.rwxr-xr-x 317k mic 19 avril 20:59  .luarocks/lib/lua/5.1/lcurl.so ` 🤔

MrMic avatar Apr 20 '24 12:04 MrMic

I have this issue on windows as well, it cant find: "xml2lua, lua-curl, mimetypes" and I've installed them outside of nvim, not sure why it cant find them.

Ive tried the solution at https://github.com/rest-nvim/rest.nvim/issues/306

Ajaymamtora avatar Apr 28 '24 23:04 Ajaymamtora

Closing due to v3 release. rest.nvim doesn't use lib-curl anymore so this won't happen.

boltlessengineer avatar Aug 22 '24 06:08 boltlessengineer