Skip to content

Commit 0e7c0c3

Browse files
authored
Merge pull request #3963 from Shopify/ko/incompatible-activation
Fix incompatible addon version activation when Bundler.setup fails after retry
2 parents b1074ef + f07643b commit 0e7c0c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

exe/ruby-lsp-launcher

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ begin
101101
Bundler.setup
102102
$stderr.puts("Composed Bundle set up successfully")
103103
end
104-
rescue Bundler::GemNotFound, Bundler::GitError
104+
rescue Bundler::GemNotFound, Bundler::GitError => e
105105
# Sometimes, we successfully set up the bundle, but users either change their Gemfile or uninstall gems from an
106106
# external process. If there's no install error, but the gem is still not found, then we need to attempt to start from
107107
# scratch
@@ -113,6 +113,10 @@ rescue Bundler::GemNotFound, Bundler::GitError
113113
exec(Gem.ruby, __FILE__, *ARGV, "--retry")
114114
end
115115
end
116+
117+
setup_error = e
118+
$stderr.puts("Failed to set up composed Bundle\n#{e.full_message}")
119+
$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
116120
rescue StandardError => e
117121
setup_error = e
118122
$stderr.puts("Failed to set up composed Bundle\n#{e.full_message}")

0 commit comments

Comments
 (0)