ruby

Configure ruby via Boxen

Les Aker

halyard

8,335 downloads

6,798 latest version

5.0 quality score

Version information

  • 8.5.7 (latest)
  • 8.5.6
  • 8.5.5
  • 8.5.4
  • 8.5.3
released Dec 15th 2015
This version is compatible with:
  • Darwin

Start using this module

Documentation

halyard/ruby — version 8.5.7 Dec 15th 2015

puppet-ruby

Puppet Forge Dependency Status MIT Licensed Build Status

Module to install ruby versions and gems

Changes from upstream

  • Removed a lot of meta-stuff I wasn't using, like the cardboard scripts
  • Removed definition files for github's custom ruby versions
  • Set up CircleCI build tests
  • Default gem version to '*'
  • Default gem name to resource title
  • Rehash rbenv after gem install
  • Switch from puppet-module-data to function bindings
  • Allow skipping rbenv init on shell creation using SKIP_RBENV_INIT environment variable

Usage

In your hiera config:

ruby::build::ensure: v20150818
ruby::rbenv::ensure: v0.4.0

"ruby::provider": "rbenv"
"ruby::user": "deployuser"

# Check https://github.com/sstephenson/ruby-build/releases for ruby-build releases
"ruby::build::ensure": "v20141028"
"ruby::chruby::ensure": "v0.3.6"
"ruby::rbenv::ensure": "v0.4.0"

# rbenv plugins
"ruby::rbenv::plugins":
  "rbenv-gem-rehash":
    "ensure": "v1.0.0"
    "source": "sstephenson/rbenv-gem-rehash"

# Environment variables for building specific versions
# You'll want to enable hiera's "deeper" merge strategy
# See http://docs.puppetlabs.com/hiera/1/configuring.html#mergebehavior
"ruby::version::env":
  "1.9.3-gentoo":
    "CC": "llvm"
    "CFLAGS": "-O9 -funroll-loops"
  "2.0.0-p0":
    "CC": "gcc"

# Version aliases, commonly used to bless a specific version
# Use the "deeper" merge strategy, as with ruby::version::env
"ruby::version::alias":
  "1.9.3": "1.9.3-p484"
  "2.0.0": "2.0.0-github"
  "2.0.0-github": "2.0.0-github6"
class { 'ruby::global':
  version => '2.2.2'
}

# ensure a gem is installed for a certain ruby version
# note, you can't have duplicate resource names so you have to name like so
$version = "2.2.2"
ruby_gem { "bundler for ${version}":
  gem          => 'bundler',
  version      => '~> 1.2.0',
  ruby_version => $version,
}

ruby_gem { 'bundler for all rubies':
  gem          => 'bundler',
  version      => '~> 1.0',
  ruby_version => '*',
}

# install a ruby version
ruby::version { '2.2.2': }

# Installing rbenv plugin
ruby::rbenv::plugin { 'rbenv-vars':
  ensure => 'v1.2.0',
  source  => 'sstephenson/rbenv-vars'
}

Details

All ruby versions are installed to /opt/rubies, using either rbenv (default) or chruby.

Required Puppet Modules