There are a two problems with the source option used with install as documented here
The documentation states that "If a URL is passed via source, then that URL is used as the remote gem repository". This is not quite true, as it adds a source to the end of the gem source list. The effect of this is that an install will always try rubygems.org first.
You should be able to use the gem install option --clear-sources to workaround the above by adding that to the package install_options. However, this provider puts the install_options on the command line at line 74 but has previously put the source option onto the command line at line 68. The order of options on the gem install command line is important in this case as you need to clear the sources before adding the source you want. Illustrated here from the puppetserver gem command line:
myhost:~ # puppetserver gem install jmx --version 1.0 --no-document --clear-sources --source https://my-internal-gem-repo/default.gems.global/
Successfully installed jmx-1.0
1 gem installed
myhost:~ # puppetserver gem uninstall jmx
Successfully uninstalled jmx-1.0
myhost:~ # puppetserver gem install jmx --version 1.0 --no-document --source https://my-internal-gem-repo/default.gems.global/ --clear-sources
ERROR: Could not find a valid gem 'jmx' (= 1.0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Connection refused - Connection refused (https://api.rubygems.org/specs.4.8.gz)
There are a two problems with the source option used with install as documented here
source
, then that URL is used as the remote gem repository". This is not quite true, as it adds a source to the end of the gem source list. The effect of this is that an install will always try rubygems.org first.--clear-sources
to workaround the above by adding that to the packageinstall_options
. However, this provider puts theinstall_options
on the command line at line 74 but has previously put thesource
option onto the command line at line 68. The order of options on the gem install command line is important in this case as you need to clear the sources before adding the source you want. Illustrated here from the puppetserver gem command line:I'll prepare a PR that addresses these.