Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Check for uninstalled gem dependencies.
require 'rubygems'
installed_gems = '', Gem::Requirement.default
missing = []
# mind the short-hand, looping over installed gem specs
specs = installed_gems
specs.each do |spec|
gem =, spec.version
# looping over gem dependencies
specs = gem
deps = specs.first.runtime_dependencies
deps.each do |dep|
# check if the dependency is missing
specs = dep
if specs === [] then
missing.push dep
print missing.sort.uniq.collect{|spec| "#{spec}\n"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.