Create a gist now

Instantly share code, notes, and snippets.

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