From 6baebf0fc8ecf99916fa0b98a092bcf1e71eb2f5 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Mon, 6 Jan 2025 17:25:03 -0500 Subject: [PATCH] Fix Bundler default bindir on Windows (#3014) --- exe/ruby-lsp | 2 +- lib/ruby_lsp/setup_bundler.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exe/ruby-lsp b/exe/ruby-lsp index 308118378..98049f100 100755 --- a/exe/ruby-lsp +++ b/exe/ruby-lsp @@ -79,7 +79,7 @@ if ENV["BUNDLE_GEMFILE"].nil? end bundler_path = File.join(Gem.default_bindir, "bundle") - base_command = (File.exist?(bundler_path) ? "#{Gem.ruby} #{bundler_path}" : "bundle").dup + base_command = (!Gem.win_platform? && File.exist?(bundler_path) ? "#{Gem.ruby} #{bundler_path}" : "bundle").dup if env["BUNDLER_VERSION"] base_command << " _#{env["BUNDLER_VERSION"]}_" diff --git a/lib/ruby_lsp/setup_bundler.rb b/lib/ruby_lsp/setup_bundler.rb index 1dab4a2f9..975c1048d 100644 --- a/lib/ruby_lsp/setup_bundler.rb +++ b/lib/ruby_lsp/setup_bundler.rb @@ -281,7 +281,7 @@ def run_bundle_install_through_command(env) # When not updating, we run `(bundle check || bundle install)` # When updating, we run `((bundle check && bundle update ruby-lsp debug) || bundle install)` bundler_path = File.join(Gem.default_bindir, "bundle") - base_command = (File.exist?(bundler_path) ? "#{Gem.ruby} #{bundler_path}" : "bundle").dup + base_command = (!Gem.win_platform? && File.exist?(bundler_path) ? "#{Gem.ruby} #{bundler_path}" : "bundle").dup if env["BUNDLER_VERSION"] base_command << " _#{env["BUNDLER_VERSION"]}_"