rest.nvim
rest.nvim copied to clipboard
Issue with finding lib-curl
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,
Hi,
How did you install rest.nvim dependencies? Also please send :checkhealth rest-nvim output
============================================================================== rest-nvim: require("rest-nvim.health").check()
Installation ~
- OK Found
luarocksinstalled in your system - OK Found Luarocks PATHs in your Neovim's Lua
package.path - OK Dependency
mimetypeswas found - OK Dependency
nvim-treesitterwas found - OK Dependency
nvim-niowas found - OK Dependency
lua-curlwas found - OK Dependency
xml2luawas found - OK Tree-sitter
httpparser is installed
Configuration ~
- OK No unrecognized configuration options were found
- OK Formatter for
jsonis set tojqand rest.nvim found it in your system - OK Formatter for
htmlis set totidyand rest.nvim found it in your system
Rgds,
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.
idk
What is package.cpath ?
Where do I find it?
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"
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 ` 🤔
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
Closing due to v3 release.
rest.nvim doesn't use lib-curl anymore so this won't happen.