1# Ruby
2
3- Tree Sitter: [tree-sitter-ruby](https://github.com/tree-sitter/tree-sitter-ruby)
4- Language Servers: [solargraph](https://github.com/castwide/solargraph), [ruby-lsp](https://github.com/Shopify/ruby-lsp)
5
6### Setting up `solargraph`
7
8Zed currently doesn't install Solargraph automatically. To use Solargraph, you need to install the gem. Zed just looks for an executable called `solargraph` on your `PATH`.
9
10You can install the gem manually with the following command:
11
12```shell
13gem install solargraph
14```
15
16Alternatively, if your project uses Bundler, you can add the Solargraph gem to your `Gemfile`:
17
18```ruby
19gem 'solargraph', group: :development
20```
21
22Solargraph has formatting and diagnostics disabled by default. We can tell Zed to enable them by adding the following to your `settings.json`:
23
24```json
25{
26 "lsp": {
27 "solargraph": {
28 "initialization_options": {
29 "diagnostics": true,
30 "formatting": true
31 }
32 }
33 }
34}
35```
36
37### Configuration
38
39Solargraph reads its configuration from a file called `.solargraph.yml` in the root of your project. For more information about this file, see the [Solargraph configuration documentation](https://solargraph.org/guides/configuration).
40
41### Setting up `ruby-lsp`
42
43Zed currently doesn't install Ruby LSP automatically. To use Ruby LSP, you need to install the gem. Zed just looks for an executable called `ruby-lsp` on your `PATH`.
44
45You can install the gem manually with the following command:
46
47```shell
48gem install ruby-lsp
49```
50
51Ruby LSP uses pull-based diagnostics which Zed doesn't support yet. We can tell Zed to disable it by adding the following to your `settings.json`:
52
53```json
54{
55 "lsp": {
56 "ruby-lsp": {
57 "initialization_options": {
58 "enabledFeatures": {
59 "diagnostics": false
60 }
61 }
62 }
63 }
64}
65```