You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
Using language server? (eg useLanguageServer is true in your configuration?) Yes
Expected behavior
I expect VS Code to find rubocop as it is installed as a gem and is accessible from the terminal.
Actual behavior
This issue is probably specific to Gitpod and I have found a solution that feels hacky. So I would like to discuss it here and see if I'm missing something. When I install Ruby with the following Dockerfile, rubocop is accessible from the terminal but VS Code can't find the command:
FROM gitpod/workspace-postgres
USER gitpod
# Install the Ruby version specified in '.ruby-version'
COPY --chown=gitpod:gitpod .ruby-version /tmp
RUN echo "rvm_gems_path=/home/gitpod/.rvm" > ~/.rvmrc
RUN bash -lc "rvm reinstall ruby-$(cat /tmp/.ruby-version) && rvm use ruby-$(cat /tmp/.ruby-version) --default && gem install rails"
RUN echo "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc
I get the following error in the Language Server Output:
Lint: executing rubocop -s '/workspace/fugu/app/controllers/projects_controller.rb' -f json -R -l...
Lint: unable to execute rubocop -s '/workspace/fugu/app/controllers/projects_controller.rb' -f json -R -l as the command could not be found
SIGPIPE received
which ruby returns this:
/home/gitpod/.rvm/rubies/ruby-3.0.0/bin/ruby
which rubocop returns this:
/workspace/.rvm/ruby-3.0.0/bin/rubocop
Both paths are in my $PATH variable.
If I install the rubocop gems like this in the Dockerfile, it works:
FROM gitpod/workspace-postgres
USER gitpod
# Install the Ruby version specified in '.ruby-version'
COPY --chown=gitpod:gitpod .ruby-version /tmp
RUN echo "rvm_gems_path=/home/gitpod/.rvm" > ~/.rvmrc
RUN bash -lc "rvm reinstall ruby-$(cat /tmp/.ruby-version) && rvm use ruby-$(cat /tmp/.ruby-version) --default && gem install rails rubocop rubocop-performance rubocop-rails rubocop-rspec"
RUN echo "rvm_gems_path=/workspace/.rvm" > ~/.rvmrc
You can find my repo here run it directly in Gitpod here (you need a free Gitpod account).
Is this expected behavior or some bug?
The text was updated successfully, but these errors were encountered:
Can you increase your log level in settings to see more details on what is being run? That does look like it isn't detecting the RVM environment correctly.
Hey @wingrunr21 yes it looks like it doesn't detect the RVM environment, and I think it's a specific issue to how Gitpod sets up the environment. I'll try to increase the log level and see if it helps. I'm travelling currently and will only get to it in about two weeks, just fyi.
Your environment
vscode-ruby
version: 0.27.0useLanguageServer
is true in your configuration?) YesExpected behavior
I expect VS Code to find
rubocop
as it is installed as a gem and is accessible from the terminal.Actual behavior
This issue is probably specific to Gitpod and I have found a solution that feels hacky. So I would like to discuss it here and see if I'm missing something. When I install Ruby with the following Dockerfile,
rubocop
is accessible from the terminal but VS Code can't find the command:I get the following error in the Language Server Output:
which ruby
returns this:which rubocop
returns this:Both paths are in my
$PATH
variable.If I install the rubocop gems like this in the Dockerfile, it works:
You can find my repo here run it directly in Gitpod here (you need a free Gitpod account).
Is this expected behavior or some bug?
The text was updated successfully, but these errors were encountered: