Unpinned Ruby gem installs in Dockerfile RUN commands allow unintentional upgrades or malicious releases to be pulled at build time, increasing risk of supply-chain compromise and causing non-reproducible or breakage-prone images.
This rule inspects Dockerfile RUN instructions that invoke gem install and requires each gem to include an explicit version, for example, via -v <version> or --version <version> (or other recognized inline version syntax). Both single-line RUN strings and tokenized RUN commands are analyzed. Any gem argument that is a plain package name without a following version flag or embedded version will be flagged.