Created
November 7, 2012 11:12
-
-
Save pkhamre/4030902 to your computer and use it in GitHub Desktop.
ruby::rubygems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Class: ruby | |
# | |
# This modules installs ruby1.8 | |
# | |
# Requires: | |
# Ubuntu | |
# | |
# Sample usage: | |
# | |
# Standard usage: | |
# node 'foobar.example.org' { | |
# include ruby | |
# } | |
class ruby { | |
package { 'ruby1.8': ensure => installed; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Class: ruby::rubygems | |
# | |
# This modules installs and sets up the rubygem environment | |
# | |
# Requires: | |
# Linux | |
# | |
# Sample usage: | |
# | |
# Standard usage: | |
# node 'foobar.example.org' { | |
# include ruby::rubygems | |
# } | |
class ruby::rubygems { | |
include ruby | |
$rubygems_version = '1.8.17' | |
exec { | |
'download rubygems tarball': | |
command => "wget http://example.org/dist/ruby/rubygems-${rubygems_version}.tgz", | |
path => ['/usr/bin'], | |
cwd => '/var/tmp', | |
creates => "/var/tmp/rubygems-${rubygems_version}.tgz"; | |
'unpack rubygems': | |
command => "tar -zxf /var/tmp/rubygems-${rubygems_version}.tgz", | |
path => ['/bin'], | |
cwd => '/var/tmp', | |
creates => "/var/tmp/rubygems-${rubygems_version}", | |
subscribe => Exec['download rubygems tarball'], | |
refreshonly => true; | |
'install rubygems': | |
command => "ruby1.8 /var/tmp/rubygems-${rubygems_version}/setup.rb --quiet", | |
path => ['/usr/bin'], | |
creates => '/usr/bin/gem1.8', | |
subscribe => Exec['unpack rubygems'], | |
refreshonly => true; | |
'update alternatives gem': | |
command => "update-alternatives --install /usr/bin/gem gem /usr/bin/gem1.8 1", | |
unless => 'test -x /usr/bin/gem'; | |
} | |
package { | |
'build-essential': ensure => installed; | |
'libssl-dev': ensure => installed; | |
'ruby1.8-dev': ensure => installed; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment