Installation

Ruby for macOS

I'm using macOS on Macbook M1 and kickstart.nvim (which contains nvim-lsp) BTW.

macOS is shipped with Ruby 2.X, but don't use it. The LSP doesn't really support the system Ruby.

Install Ruby via homebrew:

$ brew install ruby

And then add PATH to .zshrc. This is for macOS with Apple Silicon, so if you're looking for it with a different H/W architecture or on other OS, follow some other guides.

if [ -d "/opt/homebrew/opt/ruby/bin" ]; then
  export PATH=/opt/homebrew/opt/ruby/bin:$PATH
  export PATH=`gem environment gemdir`/bin:$PATH
fi

It's recommended to use a version manager like rvm or chruby.

This guide shows how to install chruby:

If you encounter problem when running ruby-install, check this out: https://github.com/rbenv/homebrew-tap/issues/9

LSP on nvim

Now on your nvim, install LSP with nvim-lsp.

:LspInstall

I installed solargraph.

References

I followed this nice guide.

Last updated