Skip to content

Commit 8b48954

Browse files
docs: add installation troubleshooting guide
1 parent e82dc52 commit 8b48954

File tree

2 files changed

+124
-2
lines changed

2 files changed

+124
-2
lines changed

INSTALLATION_TROUBLESHOOTING.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Check if plugin manager supports rockspec
2+
3+
`rest.nvim` has several dependencies specified in rockspec.
4+
You need a plugin manager supporting rockspec such as [`lazy.nvim`] and [`rocks.nvim`]
5+
to properly install this plugin.
6+
7+
## Using `lazy.nvim`
8+
9+
> [^IMPORTANT]
10+
> As this plugin already specified all required dependencies in rockspec, you don't
11+
> need to specify any dependencies as you usually do in lazyspec.
12+
13+
`lazy.nvim` requires `luarocks` as a system dependency to support rockspec.[^1][^2]
14+
15+
You can check if the installed `lazy.nvim` is properly set for rockspec through the
16+
following command.
17+
18+
```vim
19+
:checkhealth lazy
20+
```
21+
22+
In *luarocks* section, you should see something like this:
23+
24+
```
25+
...
26+
27+
luarocks ~
28+
- checking `hererocks` installation
29+
- you have some plugins that require `luarocks`:
30+
* `hererocks`
31+
* `rest.nvim`
32+
- OK {python3} `Python 3.10.12`
33+
- OK {/home/ubuntu/.local/share/nvim/lazy-rocks/hererocks/bin/luarocks} `3.11.1`
34+
- OK {/home/ubuntu/.local/share/nvim/lazy-rocks/hererocks/bin/lua} `Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio`
35+
36+
```
37+
38+
## Using `rocks.nvim` (recommended)
39+
40+
`rocks.nvim` requires `lua5.1` or `luajit` as a system dependency to work.[^3]
41+
42+
You can check if the installed `rocks.nvim` is properly set for rockspec through the
43+
following command.
44+
45+
```vim
46+
:checkhealth rocks
47+
```
48+
49+
You should see something like this:
50+
51+
```
52+
53+
==============================================================================
54+
rocks: require("rocks.health").check()
55+
56+
Checking external dependencies ~
57+
- OK luarocks: found
58+
- OK lua: found Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
59+
60+
Checking rocks.nvim config ~
61+
- OK No errors found in config.
62+
63+
Checking rocks.toml ~
64+
- OK No errors found in rocks.toml.
65+
66+
Checking tree-sitter parsers ~
67+
- OK No tree-sitter issues detected.
68+
69+
```
70+
71+
# Issue troubleshooting
72+
73+
## Dependency `...` was not found
74+
75+
This happens when your plugin manager didn't install the required dependencies specified in
76+
rockspec.
77+
Both `rocks.nvim` and *latest version of* `lazy.nvim` supports rockspec installation.
78+
If you are seeing this issue, you may be using old version of `lazy.nvim`.
79+
80+
## `lua5.1` or `lua` or `lua-5.1` version `5.1` not installed
81+
82+
By default, `lazy.nvim` will automatically install required versions of `lua` and `luarocks`
83+
*if `luarocks` doesn't exist in your machine*.
84+
But if `luarocks` exists, `lazy.nvim` won't do anything even if installed version is not compatible.
85+
86+
By setting `opts.rocks.hererocks = true` in your `lazy.nvim` config, you can force `lazy.nvim` to
87+
always install the correct versions of `lua` and `luarocks` for Neovim.
88+
89+
**Example:**
90+
```lua
91+
require("lazy").setup({
92+
spec = {
93+
-- ...
94+
"rest-nvim/rest.nvim",
95+
},
96+
rocks = {
97+
hererocks = true, -- you should enable this to get hererocks support
98+
},
99+
-- ...
100+
})
101+
```
102+
103+
`hererocks` option is completely optional but highly recommended if you don't want to deal with
104+
system package versions.
105+
106+
## Can't install on Windows
107+
108+
See [this issue](https://github.com/rest-nvim/rest.nvim/issues/463) for Windows installation.
109+
110+
---
111+
112+
Please [open a new issue](https://github.com/rest-nvim/rest.nvim/issues/new/choose) if you still
113+
have any issue after trying this guide.
114+
115+
[^1]: https://lazy.folke.io/#%EF%B8%8F-requirements
116+
[^2]: You also need `lua5.1` in your system to properly setup `luarocks`
117+
[^3]: https://github.com/nvim-neorocks/rocks.nvim?tab=readme-ov-file#pencil-requirements
118+
119+
[`lazy.nvim`]: https://github.com/folke/lazy.nvim
120+
[`hererocks`]: https://github.com/mpeterv/hererocks
121+
[`rocks.nvim`]: https://github.com/nvim-neorocks/rocks.nvim

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ CLI.
4242
## Install
4343

4444
> [!NOTE]
45-
>
46-
> rest.nvim requires Neovim >= 0.10.1 to work.
45+
> Check [this troubleshooting guide](./INSTALLATION_TROUBLESHOOTING.md) if you have any issues while
46+
> installing this plugin.
4747
4848
### Dependencies
4949

50+
- Neovim >= 0.10.1
5051
- `curl`
5152
- [tree-sitter-http] (`scm` version)
5253

0 commit comments

Comments
 (0)