Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Troubleshooting Guide #498

Open
boltlessengineer opened this issue Dec 12, 2024 · 10 comments
Open

Installation Troubleshooting Guide #498

boltlessengineer opened this issue Dec 12, 2024 · 10 comments
Assignees
Labels
installation Can’t install/setup the plugin

Comments

@boltlessengineer
Copy link
Contributor

Related: #463 #477 #493 #497

I wrote an installation troubleshooting guide to help people having issues while installing this plugin.

Feel free to open a new issue if you still have any issue after following this guide!

@boltlessengineer boltlessengineer added the installation Can’t install/setup the plugin label Dec 12, 2024
@boltlessengineer boltlessengineer self-assigned this Dec 12, 2024
@boltlessengineer boltlessengineer pinned this issue Dec 12, 2024
@boltlessengineer boltlessengineer changed the title Installation Troubleshooting Guide (especially lazy.nvim) Installation Troubleshooting Guide Dec 14, 2024
@boltlessengineer boltlessengineer marked this as a duplicate of #537 Mar 2, 2025
@uchoa
Copy link

uchoa commented Mar 12, 2025

Even though checkhealth tells me everything is ok, I still have trouble running requests, when three or four months ago it was working fine.
By the way, hererocks is set to true in my configuration.

:checkhealth lazy

lazy: require("lazy.health").check()

lazy.nvim ~

  • {lazy.nvim} version 11.16.2
  • OK {git} version 2.39.5 (Apple Git-154)
  • OK no existing packages found by other package managers
  • OK packer_compiled.lua not found

luarocks ~

  • checking hererocks installation
  • you have some plugins that require luarocks:
    • hererocks
    • rest.nvim
  • OK {python3} Python 3.13.1
  • OK {/Users/uchoa/.local/share/nvim/lazy-rocks/hererocks/bin/luarocks} 3.11.1
  • OK {/Users/uchoa/.local/share/nvim/lazy-rocks/hererocks/bin/lua} Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio

I'm not sure if I should reopen #537, or create a new issue, or do something else.

@boltlessengineer
Copy link
Contributor Author

@uchoa do you get exactly same error message from #537?
What's the output of :checkhealth rest-nvim?

@uchoa
Copy link

uchoa commented Mar 13, 2025

Yes. That's the error message I get.
:checkhealth rest-vim outputs:

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

Installation ~
- WARNING `Luarocks` is not installed in your system
  - ADVICE:
    - Are you sure you installed all needed dependencies properly?
- OK Found Luarocks PATHs in your Neovim's Lua `package.path`
- OK Dependency `xml2lua` was found
- OK Dependency `mimetypes` was found
- OK Dependency `fidget.nvim` was found
- OK Dependency `nvim-nio` was found

Response body formatters ~
- WARNING Options 'formatexpr' or 'formatprg' are not set for json filetype
- OK Option 'formatexpr' is set to `xmlformat#Format()` for xml filetype
- WARNING Options 'formatexpr' or 'formatprg' are not set for html filetype
- You can set formatter for each filetype via 'formatexpr' or 'formatprg' option

Even though I get ok when : checkhealth lazy.

@uchoa
Copy link

uchoa commented Mar 13, 2025

As I answered your questions, I remembered that I had installed neovim using homebrew, so I decided to install luarocks also using homebrew, just in case.

Now checkhealth rest-nvim outputs:

==============================================================================
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-nio` was found
- OK Dependency `fidget.nvim` was found
- OK Dependency `xml2lua` was found

Response body formatters ~
- WARNING Options 'formatexpr' or 'formatprg' are not set for json filetype
- OK Option 'formatexpr' is set to `xmlformat#Format()` for xml filetype
- WARNING Options 'formatexpr' or 'formatprg' are not set for html filetype
- You can set formatter for each filetype via 'formatexpr' or 'formatprg' option

The error message is still the same, though.

@boltlessengineer
Copy link
Contributor Author

boltlessengineer commented Mar 14, 2025

@uchoa The system luarocks & lua version should not matter because lazy will automatically install them. Actually I'd recommend to not install both lua or luarocks from homebrew because they are missing the required versions unless you set rocks.hererocks = true from our lazy.nvim config.

I wonder why lazy.nvim didn't throw an error during installation... 🤔

Can you reproduce it with this minimal config?
Save the snippet below as repro.lua and run nvim -u repro.lua.
It will create .repro/ directory in cwd and clean install rest.nvim with minimal lazy.nvim config.
You can remove the .repro directory after testing.

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
    rocks = {
        hererocks = true,
    },
    spec = {
        "rest-nvim/rest.nvim",
        {
            "nvim-treesitter/nvim-treesitter",
            build = ":TSUpdate",
            main = "nvim-treesitter.configs",
            opts = {
                ensure_installed = { "http" },
                sync_install = false,
                highlight = { enable = true },
                indent = { enable = true },
            },
        },
    },
})

If this works, try setting rocks.hererocks = true on your lazy.nvim config (reference: https://lazy.folke.io/configuration), uninstall rest.nvim and reinstall it.

Edit: fixed typo in repro.lua snippet.

@uchoa
Copy link

uchoa commented Mar 17, 2025

rocks.hererocks is already true in my lazy config. But I'll try your suggestion and bring the feedback here.

@CudaSlayer
Copy link

Similar error. I had to manually install luarocks to make this work. And I have lazy ^11.17.

@boltlessengineer
Copy link
Contributor Author

@CudaSlayer Do you still have to install luarocks while setting rocks.hererocks = true? Because that's exactly why hererocks option exists, to use correct luarocks version instead of system one that might have mismatched version.

@CudaSlayer
Copy link

CudaSlayer commented Mar 21, 2025

@CudaSlayer Do you still have to install luarocks while setting rocks.hererocks = true? Because that's exactly why hererocks option exists, to use correct luarocks version instead of system one that might have mismatched version.

@boltlessengineer Didn't test it. I just used the snippet that was in the readme:

{
  "rest-nvim/rest.nvim",
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
    opts = function (_, opts)
      opts.ensure_installed = opts.ensure_installed or {}
      table.insert(opts.ensure_installed, "http")
    end,
  }
}

Then I ran into a plethora of errors after installing rest. Then I had to manually install http, new errors cropped up. After I checked for :checkhealth rest.nvim, I saw luarocks wasn't installed, so I installed it. I came to check the GH issues if someone had similar issues and found one.

@boltlessengineer
Copy link
Contributor Author

@CudaSlayer uninstall rest.nvim and try reinstall it with rocks.hererocks = true option set as I suggested in troubleshooting guide. Feel free to ask again if you still have trouble after following the guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Can’t install/setup the plugin
Projects
None yet
Development

No branches or pull requests

3 participants