Skip to content

Instantly share code, notes, and snippets.

@zmalltalker
Last active November 3, 2016 12:59
Show Gist options
  • Save zmalltalker/5900206 to your computer and use it in GitHub Desktop.
Save zmalltalker/5900206 to your computer and use it in GitHub Desktop.
Install ruby-install, chruby and ruby 1.9.3 on Centos - Install puppet - Run `puppet apply <(curl -S https://gist.github.com/zmalltalker/5900206/raw/b9d7c2263cef981a8384a4e2b513e67c70060436/gistfile1.pp)`
# 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