You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: TROUBLESHOOTING.md
+41-1
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,47 @@ to index for features such as go to definition.
36
36
37
37
## Common issues
38
38
39
-
There are two main sources of issues users typically face during activation: shell or Bundler related problems.
39
+
There are several main sources of issues users typically face during activation: outdated version, shell problems, or Bundler related problems.
40
+
41
+
### Outdated Version
42
+
43
+
> [!NOTE]
44
+
> If using VS Code, the version of the extension is distinct from that of the server (the `ruby-lsp` gem). You can check the server version in the [status center](https://github.com/Shopify/ruby-lsp/blob/main/vscode/extras/ruby_lsp_status_center.png).
45
+
46
+
In most cases, the server gem will be automatically updated. You can also trigger a manual update with the "Update language server gem" command in VS Code.
47
+
48
+
You can also attempt an update from the command line with `BUNDLE_GEMFILE=.ruby-lsp/Gemfile bundle update ruby-lsp`
49
+
50
+
> [!NOTE]
51
+
> If you're using any addon gem, such as `ruby-lsp-rspec`, then `ruby-lsp` will also be present in your `Gemfile.lock` and it's possible that an outdated addon could prevent `ruby-lsp` from updating.
52
+
53
+
A common problem is that the `ruby-lsp` gem cannot be updated due to another dependency's constraints:
54
+
55
+
**Prism constraints**
56
+
57
+
Since v0.12.0, Ruby LSP has had a dependency on the [Prism](https://rubygems.org/gems/prism) parser.
58
+
Prior to that, the Prism parser was named [YARP](https://rubygems.org/gems/yarp). The fact that the gem was renamed leads to some awkward dependency resolutions issues.
59
+
Since Prism is a pre-1.0 release, there may be breaking changes introduced in minor versions.
60
+
For that reason, we constrain the version of Prism up to that which is known to be compatible.
61
+
62
+
With the custom bundle approach described earlier, Bundler resolves a version of Ruby LSP which is compatible the dependencies already in your `Gemfile.lock.`
63
+
64
+
When a new version of Prism is released, it will take a little time for us as Ruby LSP maintainers to verify the compatibility, and make any necessary updates.
65
+
66
+
During that time, it's possible for the Prism version in your `Gemfile.lock` to be increased due to being a dependency of another gem in your bundle.
67
+
68
+
If Prism is locked to a newer version not yet supported by the Ruby LSP, then the only outcome that satisfies Bundler's checks is to install the very old versions that depend on the old name YARP.
69
+
70
+
Once Prism v1.0 is released, we will relax the version constraint to alleviate this problem.
71
+
72
+
**Other constraints**
73
+
74
+
Ruby LSP has a dependency on [RBS](https://github.com/ruby/rbs) v3.
75
+
If another gem constrains the version of RBS to an older release, it will not be possible to use newer versions of Ruby LSP.
76
+
77
+
There is also dependency on `sorbet-runtime` which is used by a number of other gems.
78
+
79
+
Running `BUNDLE_GEMFILE=.ruby-lsp/Gemfile bundle outdated` may help with understanding what is being constrained.
0 commit comments