vscode error: typeprof running on wrong ruby
Nessuno ha ancora preso questa issue.
- Lingua principale
- Ruby
- Stelle
- 833
- Fork
- 99
- Merge medio
- 9h 30m
- PR unite (30g)
- 12
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia in vscode/src/extension.ts intorno alle righe 72-83, dove l’issue segnala che TypeProf viene avviato tramite Bundler, e confronta il punto di ingresso dell’estensione steep-vscode collegata. Riproduci la configurazione chruby/VSCode, quindi verifica che TypeProf usi il Ruby selezionato prima di aprire il progetto invece del Ruby di sistema; l’errore riportato non dovrebbe più fare riferimento al percorso del Ruby di sistema.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- ruby, vscode
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100