Closed tombohub closed 1 year ago
Did you add the .ruby-version
file after the warning? Have you tried restarting? Is there anything in the output tab under the Ruby LSP channel?
Facing similar issue. Using VS Code attached with a container. The Ruby LSP Channel shows the following
>> Running `bundle install`...
>> `bundle install` exited with code -2
Having the exact same issue with the same output in the Ruby LSP channel with VSCode attached to a container (Dev Containers extension). Tried restarting, same error. Tried running
BUNDLE_GEMFILE=/path/to/your/project/.ruby-lsp/Gemfile bundle install
manually (with the right path to the Gemfile, of course), ruby-lsp
gem installs properly but it still fails with the same error in the output channel when trying to restart.
@vinistock You can try the extension with rails docked to see if it actually works https://github.com/rails/docked
Did you add the
.ruby-version
file after the warning? Have you tried restarting? Is there anything in the output tab under the Ruby LSP channel?
I installed the extension then followed the troubleshoot. Right now I opened the same project which already has .ruby-version file and got the error:
I restarted VScode, yes.
Where do I see Ruby LSP channel?
output is empty:
I added chruby
part, now getting another error. Here is the whole screenshot:
Is your .ruby-version
file empty like it is in the screenshot?
If that's the case, you need to specify a version there (e.g.: 3.2.1). And if this is the case, we'll need to improve that error message for when .ruby-version
is empty.
@vinistock yes, it's empty. Reason is that I didn't know I need to put anything inside. I'm beginner and just wanted to check out ruby in vscode. Thanks
I have put version and now having this error:
Failed to activate chruby environment: Command failed:
undefined -lic 'chruby "3.1.3" && ruby --disable-gems -rjson
-e "printf(%{RUBY_ENV_ACTIVATE%sRUBY_ENV_ACTIVATE}, JSON.dump(ENV.to_h))"'
'undefined' is not recognized as an internal or external command, operable program or batch file.
screenshot:
It looks like your SHELL
environment variable is not set. But given that you're using Windows, I don't think chruby
supports it, does it? I think it requires bash
or zsh
to be your shell.
If you're using Windows, I believe Shopify/ruby-lsp#1571 will help Windows users activate the right Ruby version more easily.
Where is the guide for people running ruby through docker
using Windows, I don't think
chruby
supports it, does it? I think it requiresbash
orzsh
to be your shell.
I am not sure, I am really not familiar with ruby ecosystem. So none of these version managers magers support Windows?:
In that case I have to wait Shopify/ruby-lsp#1571
Sidenote: There are multiple approaches to running Ruby on Windows. If you use WSL then you will can have access to all the standard tools:
See https://github.com/Shopify/ruby-lsp/pull/620 and https://github.com/Shopify/vscode-ruby-lsp/pull/546
Fixes this issue
How do you make the extension work if you're running ruby through a docker environment?
@guledali this issue is about a different problem. For container related things, can you please see if https://github.com/Shopify/ruby-lsp/issues/1552 solves the issue or post a comment there?
My understanding is that using the official remote extension allows you to connect VS Code to containers and then any extension should just run seamlessly.
I just released v0.2.5 which includes some relevant fixes for Windows. If you'd like to try it, you should set your version manager to none
. Please report back if more issues come up.
Hi, I've tried, but have this error, what does it mean?
Apparently, on Windows you'll need custom activation. It will be solved by Shopify/ruby-lsp#1571.
Version v0.3.0 includes the new custom activation. Please try the instructions and report back if any problems persist.
Vscode: 1.76.2 OS: Win10 rubyLSP: 0.2.3
Installed in VSCode and did not start,, this is the error:
Tried to troubleshoot, followed steps then this error:
this is the folder tree: