Skip to content

Got error when running on Windows 11 WSL in docker container #1784

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

Closed
mik356ua opened this issue Oct 11, 2023 · 3 comments
Closed

Got error when running on Windows 11 WSL in docker container #1784

mik356ua opened this issue Oct 11, 2023 · 3 comments
Labels
bug Something isn't working help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale

Comments

@mik356ua
Copy link

mik356ua commented Oct 11, 2023

Ruby version

3.1.3

Code snippet

No response

Description

I use Windows 11 with WSL version 2 enabled and Ubuntu 22.04 distro installed. Also Docker Desktop installed to enable docker support. My ruby app source code located at Ubuntu filesystem and runs in docker container. When I install and enable Ruby LSP extension on 'WSL: Ubuntu' in vscode I see this error:

Failed to activate none environment: Command failed: /bin/bash -ic 'ruby -rjson -e "printf(%{RUBY_ENV_ACTIVATE%sRUBY_ENV_ACTIVATE}, JSON.dump(ENV.to_h))"' bash: initialize_job_control: no job control in background: Bad file descriptor your 131072x1 screen size is bogus. expect trouble your 131072x1 screen size is bogus. expect trouble Command 'ruby' not found, but can be installed with: sudo apt install ruby

Also I tried to add gem "ruby-lsp" to my Gemfile run docker compose exec web bundle and restart vscode but that didn't help (same error).

Here is my Dockerfile:

FROM ruby:3.1.3
RUN gem update --system && gem install bundler
RUN mkdir -p /app
WORKDIR /app
COPY Gemfile Gemfile.lock ./ 
RUN bundle install --jobs 20
EXPOSE 3000
CMD rm -f tmp/pids/server.pid && /app/bin/rails server -p 3000 -b '0.0.0.0';

and docker-compose.yml:

services:
  web:
    build:
      context: .
      dockerfile: ./.docker/Dockerfile
    container_name: web
    stdin_open: true
    tty: true
    environment:
      PORT: 3000
      BINDING: 0.0.0.0
    ports:
      - "3000:3000"
    volumes:
      - .:/app

Any help is much appreciated. Thanks in advance!

Expected output

Expect ruby-lsp to start without any errors

@mik356ua mik356ua added the bug Something isn't working label Oct 11, 2023
@vinistock
Copy link
Member

Thank you for the bug report! This is specifically related to the VS Code extension, so I'll transfer the issue to that repo.

It seems like it could be related to #1794. On both cases, the extension is unable to find things that should be in the path, like the version manager executable or Ruby itself.

Not sure what the solution would be. If VS Code is configured to run inside the docker container, it should have access to what is installed there.

@vinistock vinistock transferred this issue from Shopify/ruby-lsp Oct 11, 2023
@vinistock vinistock added help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale labels Oct 11, 2023
@st0012 st0012 transferred this issue from Shopify/vscode-ruby-lsp Mar 18, 2024
@vinistock
Copy link
Member

@mik356ua If you try the latest v0.7.0 and follow the instructions here to connect VS Code to the docker container, are you still seeing issues?

@vinistock
Copy link
Member

I'll close this for now. Please let us know if the latest version is still erroring.

@vinistock vinistock closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants