From 87c6582638a2357af39e100da8d41aa77d00f083 Mon Sep 17 00:00:00 2001 From: Prajakta Purohit Date: Tue, 19 Apr 2016 12:37:05 -0700 Subject: Update rubygems provider to support local install of gems if so specified --- lib/chef/provider/package/rubygems.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/chef/provider/package/rubygems.rb') diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb index 39eff19bd0..a15ee1bdea 100644 --- a/lib/chef/provider/package/rubygems.rb +++ b/lib/chef/provider/package/rubygems.rb @@ -517,7 +517,9 @@ class Chef install_via_gem_command(name, version) end elsif @new_resource.gem_binary.nil? - @gem_env.install(@new_resource.source) + # domain is used by Gem::DependencyInstaller rather than by Chef code + # domain can be :local, :remote or :both + @gem_env.install(@new_resource.source, domain: :local) else install_via_gem_command(name, version) end @@ -531,6 +533,7 @@ class Chef def install_via_gem_command(name, version) if @new_resource.source =~ /\.gem$/i name = @new_resource.source + src = " --local" unless source_is_remote? elsif @new_resource.clear_sources src = " --clear-sources" src << (@new_resource.source && " --source=#{@new_resource.source}" || "") -- cgit v1.2.1