You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhancement: read the Ruby version from ruby file: ".ruby-version" and .ruby-version #625
extractRubyVersion in src/core-open/scanners/ruby-scanner.ts only understands ruby '3.3.0' in the Gemfile. Bundler 2.4+ projects often write ruby file: ".ruby-version", and many apps have no ruby line at all and rely on .ruby-version (or .tool-versions). In both cases vg scan reports no Ruby runtime and no runtime lag.
What to do
Support ruby file: "<path>" (and ruby file: '<path>') by reading that file relative to the Gemfile.
When the Gemfile has no ruby line, fall back to .ruby-version next to it, then a ruby entry in .tool-versions.
Strip a leading ruby- prefix (ruby-3.3.0) as rbenv/rvm write it.
Add unit tests.
Acceptance
ruby file: ".ruby-version" with 3.3.4 in that file reports runtime 3.3.4.
A Gemfile with no ruby line and a .ruby-version of ruby-3.2.2 reports 3.2.2.
An explicit ruby '3.1.0' line still wins over the files.
Confirmed: extractRubyVersion (line 392 of src/core-open/scanners/ruby-scanner.ts) only matches literal ruby '...' lines, so ruby file: ".ruby-version" and Gemfiles without a ruby line give no runtime.
Order of precedence I'd suggest: an explicit ruby 'x.y.z', then ruby file: resolved relative to the Gemfile, then .ruby-version beside it, then the ruby line of .tool-versions. Strip a ruby- prefix and trim whitespace. Since the scanner already reads files through the cache around line 484, keep the new reads there so extractRubyVersion stays a pure parser that is easy to unit-test.
Activity
vibgrate-team commentedon Nov 10, 2026
Confirmed:
extractRubyVersion(line 392 ofsrc/core-open/scanners/ruby-scanner.ts) only matches literalruby '...'lines, soruby file: ".ruby-version"and Gemfiles without arubyline give no runtime.Order of precedence I'd suggest: an explicit
ruby 'x.y.z', thenruby file:resolved relative to the Gemfile, then.ruby-versionbeside it, then therubyline of.tool-versions. Strip aruby-prefix and trim whitespace. Since the scanner already reads files through the cache around line 484, keep the new reads there soextractRubyVersionstays a pure parser that is easy to unit-test.