-
Notifications
You must be signed in to change notification settings - Fork 128
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
gem install fails if system installation directory is read-only #1791
Comments
Indeed, we have to execute the server with The associated PR should fix this. |
I've verified that the extension is successfully able to start the ruby-lsp command using It would be great to have it support installing the ruby-lsp gem into a user-writable directory when I think the way this could be done would be to install the ruby-lsp gem in a global private data directory directory for the extension (rather than in each and every project dir) using bundler with a path configured; this should be done within the |
I'd also like to note that the |
That's fair, I'm re-opening the issue. Given that the Ruby LSP is installed based on each Ruby version, it might not be very straight forward to just download it like Rust Analyzer does. The Ruby LSP needs access to the project's bundle, which means it needs to be installed for the Ruby version being used in that project. For people using version managers, that could be several different versions, so we need to account for that when installing in VS Code's global storage path. We'd be open to having this, but it needs to remain working seamlessly for people using version managers. Concerning using an absolute bundle gemfile, that should be a straight forward fix. Do you want to take a stab at it? |
Fix for the absolute path for the custom bundle Shopify/vscode-ruby-lsp#750. |
This issue is being marked as stale because there was no activity in the last 2 months |
Operating System
Exherbo Linux
Ruby version
3.0
Project has a bundle
Ruby version manager being used
no manager
Description
Using extension version 0.4.3. This is a regression from version 0.3.7. This issue appears to be related to #1640
I was using ruby-lsp with my operating system provided ruby, rather than ruby installed using a separate version manager. As a result, the standard gem installation directory is a system directory which is not writable by my user, and the extension initialization in 0.4.3 fails with the following error message:
This is expected; when using the system ruby, any extra per-user gems outside of bundle need to be installed somewhere else. But if I manually install the ruby-lsp gem with the command
gem install --user-install ruby-lsp
to try to work around this problem, gem prints this warning:and indeed, the extension fails to start ruby-lsp:
But I don't want to install extra ruby gems in my "user-install" directory anyways, I'd prefer to have them privately installed in each project dir… so I tried to use the "Bundle Gemfile" configuration provided to replicate the behaviour of 0.3.7: I set
"rubyLsp.bundleGemfile": ".ruby-lsp/Gemfile"
and created the following Gemfile there:I ran
bundle config set --local path vendor/bundle
in that directory to tell bundler to install the gems in that directory rather than in a system location, and did a bundle install.But as far as I can tell, this configuration is non-functional; even with the Bundle Gemfile configuration set, the extension is still printing the same error message saying that it's trying to run
gem install ruby-lsp
. There's no code in theinstallOrUpdateServer
function to handle checking if ruby-lsp is installed in a bundle environment, and also no code instart
to handle starting ruby-lsp using bundler.The text was updated successfully, but these errors were encountered: