Here’s the situation: You’ve written a Ruby gem that you want to install on a server, but you don’t really have any need to share the gem with the world via RubyGems.org. It’s a custom gem with bespoke code that no one would benefit from. You’ve pushed the gem to your Gem server and you use Puppet to manage your servers.

Here’s a simple, example Puppet manifest, showing how to install gem via Puppet from a custom source:

# manifest.pp
node default {
  package { 'cautious-potato':
    provider => 'gem',
    source => 'http://mygemserver.com',
    ensure => '0.1.0'
  }
}

Then apply that manifest:

sudo puppet apply --test manifest.pp

…and you should see version 0.1.0 of the gem installed from your own Gem server!

It took me a while to figure this out and I only worked out how to do it whilst reading through the source of the Gem Package provider in Puppet. I hope this saves others from wasting too much time on working out how to do this, like I did!