diff --git a/lib/mg.rb b/lib/mg.rb index 4e4db83..e2a84cb 100644 --- a/lib/mg.rb +++ b/lib/mg.rb @@ -33,7 +33,11 @@ def define_tasks desc "Build and install as local gem" task "gem:install" => package(".gem") do - sh "gem install #{package(".gem")}" + Bundler.with_clean_env do + sh "gem install #{package(".gem")}" do |_,result| + raise unless result.to_i.zero? + end + end end desc "Build gem into dist/"