Skip to content

Instantly share code, notes, and snippets.

@charlesjohnson
Created February 22, 2015 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charlesjohnson/e229efbb473aeba246c2 to your computer and use it in GitHub Desktop.
Save charlesjohnson/e229efbb473aeba246c2 to your computer and use it in GitHub Desktop.
A dirty gem trick, install dependency gems without prompting the user if that's what they actually want.
begin
gem 'chef-api'
rescue LoadError
require 'rubygems/dependency_installer'
Gem::DependencyInstaller.new(Gem::DependencyInstaller::DEFAULT_OPTIONS).install('chef-api')
end
require 'chef-api'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment