From 87da39341d49f43bd5765b8ee1ea8d08371929e8 Mon Sep 17 00:00:00 2001 From: Almir Davletov Date: Wed, 25 Feb 2026 14:04:41 -0800 Subject: [PATCH] [VS Code] Resolve ruby path correctly with chruby --- vscode/chruby_activation.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/vscode/chruby_activation.rb b/vscode/chruby_activation.rb index 35e082dcff..7bc6e22a58 100644 --- a/vscode/chruby_activation.rb +++ b/vscode/chruby_activation.rb @@ -8,12 +8,10 @@ paths = Gem.path default_dir = Gem.default_dir -if paths.length > 2 - paths.delete(default_dir) - paths.delete(user_dir) - first_path = paths[0] - user_dir = first_path if first_path && Dir.exist?(first_path) -end +paths.delete(default_dir) +paths.delete(user_dir) +first_path = paths[0] +user_dir = first_path if first_path && Dir.exist?(first_path) newer_gem_home = File.join(File.dirname(user_dir), ARGV.first) gems = Dir.exist?(newer_gem_home) ? newer_gem_home : user_dir