Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running in Docker #541

Open
obahareth opened this issue Dec 7, 2024 · 3 comments
Open

Running in Docker #541

obahareth opened this issue Dec 7, 2024 · 3 comments

Comments

@obahareth
Copy link

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?

@andyw8
Copy link
Contributor

andyw8 commented Dec 9, 2024

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.

@obahareth
Copy link
Author

obahareth commented Dec 11, 2024

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.

@andyw8
Copy link
Contributor

andyw8 commented Dec 11, 2024

We don't offer a way to change this, it's set here:

Open3.popen3("bundle", "exec", "rails", "runner", "#{__dir__}/server.rb", "start")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants