Bundler settings containing spaces are rewritten with colons when composing the bundle

未关闭 适合新手
#4,275 1 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@efegokdemir 已经在做这个了。

开始于 2026年11月18日。

  • #4278 来自 @efegokdemir —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
ruby
领域
tooling

调研方向

从 SetupBundler#bundler_settings_as_env 开始,检查它如何将 Bundler 设置转换为环境变量。按照 issue 中的步骤 bundle config set --local path "vendor/my bundle" 重现问题,然后检查组合后的 bundle 是否保留路径中的空格,同时列表设置是否仍然有效。路径得到保留且服务器不再因报告的路径分隔符错误而退出时,即为完成。

由索引模型根据 Issue 内容生成。

描述

Description

SetupBundler#bundler_settings_as_env passes every Bundler setting to the composed bundle's bundle install as an environment variable, and runs every value through .tr(" ", ":"):

value = Array(settings[e]).join(":").tr(" ", ":")

That suits list settings like without, but it also rewrites file paths. A path setting that contains a space ends up pointing at a path that doesn't exist, and the server fails to start.

We hit it with BUNDLE_SSL_CA_CERT. Aikido's endpoint agent on macOS sets it to /Library/Application Support/AikidoSecurity/EndpointProtection/run/endpoint-protection-ruby-combined-ca.pem. The composed bundle gets /Library/Application:Support/..., so whenever it needs to fetch a gem, bundle install fails with:

OpenSSL::X509::StoreError: X509_LOOKUP_load_file: BIO lib

Claude code shows the error as:

Language server "plugin:ruby-lsp:ruby-lsp" couldn't start. The Errors tab in /plugin may have the reason.

plugin:ruby-lsp:ruby-lsp @ unknown (user)
LSP server plugin:ruby-lsp:ruby-lsp crashed with exit code 1

A plain bundle install in the same shell works.

Ruby LSP Information
  • ruby-lsp 0.26.11
  • Bundler 4.0.20, Ruby 3.4.12, macOS
  • Editor: Claude Code, which runs ruby-lsp directly. The failure is in the server's bundle setup, so the editor shouldn't matter.
Reproduction steps

A path setting shows it without any certificate setup:

mkdir lsp-space && cd lsp-space
printf 'source "https://rubygems.org"\ngem "rake"\n' > Gemfile
bundle lock
bundle config set --local path "vendor/my bundle"
ruby-lsp < /dev/null

The composed bundle installs into vendor/my:bundle, then the server exits with status 13:

Bundled gems are installed into `./vendor/my:bundle`
Your bundle path contains text matching ":", which is the path separator for
your system. Bundler cannot function correctly when the Bundle path contains the
system's PATH separator. Please change your bundle path to not match ":".
Suggested fix

Drop the .tr(" ", ":"). Bundler::Settings#[] already returns an array for list settings, because to_array splits on spaces and colons. So .join(":") alone gives development:test for BUNDLE_WITHOUT="development test" and leaves vendor/my bundle unchanged. The .tr came in with #2595.

主要语言
Ruby
星标
2k
派生
300
平均合并
2 小时 54 分钟
30 天内合并 PR
9

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Shopify/ruby-lsp 的其他 Issue

查看 Shopify/ruby-lsp 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。