vscode error: typeprof running on wrong ruby
还没有人认领这个 Issue。
评估
调研方向
从 vscode/src/extension.ts 第72-83行附近开始,这里 issue 报告了 TypeProf 是通过 Bundler 启动的,并与链接的 steep-vscode 扩展入口点进行比较。复现 chruby/VSCode 设置,然后验证 TypeProf 使用的是打开项目之前选择的 Ruby,而不是系统 Ruby;报告的错误不应再引用系统 Ruby 路径。
由索引模型根据 Issue 内容生成。
描述
Hi, I have a local setup using chruby (shouldn't be much different from other setups). I usually switch to the right ruby then open the project on VSCode via code ., in order to make sure that the extensions use the right ruby and deps versions. This works well for the steep plugin. However, the typeprof plugin picks up the wrong ruby, i.e. the system ruby. So, I switch to ruby 3, but I get the following error output from within vscode:
[vscode] Try to start TypeProf for IDE
[vscode] stderr: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.2.15) required by your /Users/tiago.cardoso/dev/jwt-token-kms/Gemfile.lock. (Gem::GemNotFoundException)
[vscode] stderr: To update to the latest version installed on your system, run `bundle update --bundler`.
[vscode] stderr: To install the missing version, run `gem install bundler:2.2.15`
[vscode] stderr: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
[vscode] stderr: from /usr/bin/bundle:23:in `<main>'
[vscode] failed to invoke typeprof: error code 1
# that's the location from system ruby, not ruby 3
I suspect I'm entering this path, where the extensions recognizes the existence of a Gemfile, and runs typeprof via bundler, but picks up the wrong bundler. And this might be so because typeprof's not picking up the ruby defined by the VSCode ruby plugin, which I set to ruby (should have been ruby 3). steep does this a bit differently, but can't figure out what's the correct way to patch typeprof's command.
- 主要语言
- Ruby
- 星标
- 833
- 派生
- 99
- 平均合并
- 9 小时 30 分钟
- 30 天内合并 PR
- 12
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/typeprof 的其他 Issue
-
难度 5/5 一周以上 新手友好度 28/100
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 25/100
-
难度 2/5 1-3 小时 新手友好度 38/100
-
难度 3/5 1-2 天 新手友好度 30/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
palladius/rails8-app-on-gcp#145 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
rubocop/rubocop-rspec#2236 ·
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
riscv/riscv-unified-db#2624 · 1 个 reaction ·
-
难度 1/5 1 小时以内 新手友好度 88/100