Running in Docker
Hey,
I have Ruby LSP working just fine via ASDF on my local machine (macOS) on VS Code, but none of the Rails features are working. I don't use any of the VS Code remote features, I run docker compose up in my terminal. The documentation says that the Rails LSP should just work "automatically".
What's the process like for getting it running in Docker Compose, do I need to add anything to my project's gemfile?
Does the gem need to be able to hook into my Rails app/server somehow?
Hi @obahareth
For the Rails features, the add-on communicates with your app via the Rails runner command. If you try run bin/rails runner 'puts 1' locally and it fails, then the Rails add-on features won't work either.
See Developing inside a Container for the supported approach.
Hey @andyw8, thanks for your quick response!
Is there any way I can give it a custom command to do something like docker compose run my_app rails runner?
VS Code's version of this seems like a major flow change. My editor currently has 0 interaction with my container, everything happens via the terminal.
We don't offer a way to change this, it's set here:
https://github.com/Shopify/ruby-lsp-rails/blob/955dc27e44c015f5839a438d37b03a64f2cb1642/lib/ruby_lsp/ruby_lsp_rails/runner_client.rb#L74