rest-nvim / rest.nvim

A fast Neovim http client written in Lua
GNU General Public License v3.0
1.35k stars 117 forks source link

Unable to install and use with Debian12 / Lazyvim #388

Open 99Percent opened 1 month ago

99Percent commented 1 month ago

I was unable to get rest.nvim working with lazyvim in my debian 12 setup.

I created a file in $HOME/.config/nvim/lua/plugins called rest.lua I copy and pasted the following:

return {
{
  "vhyrro/luarocks.nvim",
  priority = 1000,
  config = true,
  opts = {
    rocks = { "lua-curl", "nvim-nio", "mimetypes", "xml2lua" }
  }
},
{
  "rest-nvim/rest.nvim",
  ft = "http",
  dependencies = { "luarocks.nvim" },
  config = function()
    require("rest-nvim").setup()
  end,
},
}

I get the following warning: This function requires 1 argument(s) but instead it is receiving 0. in the require("rest-nvim").setup() which I initially ignored.

I run :Lazy rest.nvim but I get the following errors:


Error: Failed installing dependency: https://luarocks.org/lua-curl-0.3.13-1.src.rock - Could not find header file for CURL
  No file curl/curl.h in /usr/local/include
  No file curl/curl.h in /usr/include
  No file curl/curl.h in /include
You may have to install CURL in your system and/or pass CURL_DIR or CURL_INCDIR to the luarocks command.
Example: luarocks install lua-curl CURL_DIR=/usr/local
Missing dependencies for neovim-rocks-user-rockspec 0.0-0:
   lua-curl ~> 0.3 (not installed)
   mimetypes ~> 1.0 (not installed)
   xml2lua ~> 1.5 (not installed)

neovim-rocks-user-rockspec 0.0-0 depends on nvim-nio ~> 1.7 (1.7.0-1 installed: success)
neovim-rocks-user-rockspec 0.0-0 depends on lua-curl ~> 0.3 (not installed)
Installing https://luarocks.org/lua-curl-0.3.13-1.src.rock

stack traceback:
    [C]: in function 'assert'
    ...hare/nvim/lazy/luarocks.nvim/lua/luarocks-nvim/rocks.lua:34: in function 'install'
    ...hare/nvim/lazy/luarocks.nvim/lua/luarocks-nvim/rocks.lua:67: in function 'ensure'
    /home/david/.local/share/nvim/lazy/rest.nvim/build.lua:14: in function </home/david/.local/share/nvim/lazy/rest.nvim/build.lua:9>

I have already tried to install all the rocks (with sudo or the --local flag) required with many issues but it seems like it completed successfully in the end. I still get those dependancy errors.

The command :checkhealth rest-nvim returns: - ERROR No healthcheck found for "rest-nvim" plugin.

I then inserted the default options in the plugins file in the setup function and ran :Lazy build rest.nvim again. I got the same failed dependancy errors as before but now `checkhealth rest-nvim shows correctly with no issues.

Installation ~
- OK Found `luarocks` installed in your system
- OK Found Luarocks PATHs in your Neovim's Lua `package.path`
- OK Dependency `lua-curl` was found
- OK Dependency `nvim-nio` was found
- OK Dependency `nvim-treesitter` was found
- OK Dependency `xml2lua` was found
- OK Dependency `mimetypes` 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

But... The command :Rest in not available so I quit lazyvim and restart but now the command :healthcheck rest-nvim returns

- ERROR No healthcheck found for "rest-nvim" plugin.

and the command :Rest is still not available.

Sometimes the command :healthcheck rest-nvim simply quits neovim with no log or messages

I am completely lost, please help, I really want to use this.

muneebusmani commented 3 weeks ago

same issue on archlinux cant utilize this plugin with lazy.nvim/Lazyvim