Skip to content

Instantly share code, notes, and snippets.

@helstern
Forked from zmalltalker/gist:5900206
Last active August 29, 2015 14:14
Show Gist options
  • Save helstern/50e2c4da1770888d556f to your computer and use it in GitHub Desktop.
Save helstern/50e2c4da1770888d556f to your computer and use it in GitHub Desktop.
# chruby
# ruby-install
# ruby 1.9.3
# /etc/profile.d/chruby.sh
Exec {
path => ["/bin","/usr/bin", "/usr/local/bin"]
}
file { "/etc/profile.d/chruby.sh":
ensure => present,
owner => root,
group => root,
mode => 0755,
content => "source /usr/local/share/chruby/chruby.sh
chruby 1.9.3-p448
",
require => [
Exec["install_chruby"],
Exec["install_ruby_install"],
Exec["install_ruby"]],
}
exec {"install_ruby":
require => Exec["install_ruby_install"],
command => "ruby-install ruby 1.9.3-p448",
creates => "/opt/rubies/ruby-1.9.3-p448"
}
exec { "install_ruby_install":
command => "/bin/bash -c 'cd /tmp && wget -O ruby-install-0.2.1.tar.gz https://github.com/postmodern/ruby-install/archive/v0.2.1.tar.gz && tar -xzvf ruby-install-0.2.1.tar.gz && cd ruby-install-0.2.1/ && make install'",
creates => "/usr/bin/ruby-install",
}
exec { "install_chruby":
command => "/bin/bash -c 'cd /tmp && wget -O chruby-0.3.6.tar.gz https://github.com/postmodern/chruby/archive/v0.3.6.tar.gz && tar -xzvf chruby-0.3.6.tar.gz && cd chruby-0.3.6/ && make install'",
creates =>"/usr/local/share/chruby/chruby.sh",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment