Skip to content

Instantly share code, notes, and snippets.

@brysgo
Forked from zmalltalker/gist:5900206
Last active December 27, 2015 23:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brysgo/0183a8dded41b1356107 to your computer and use it in GitHub Desktop.
Save brysgo/0183a8dded41b1356107 to your computer and use it in GitHub Desktop.
Install ruby-install, chruby and ruby 2.2.0 on Centos - Install puppet - Run `puppet apply <(curl -S https://gist.githubusercontent.com/brysgo/0183a8dded41b1356107/raw/103f4a87ecd143285da444c4e5c24b70680256cb/gistfile1.pp)`
# chruby
# ruby-install
# ruby 2.2.0
# /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 2.2.0
",
require => [
Exec["install_chruby"],
Exec["install_ruby_install"],
Exec["install_ruby"]],
}
exec {"install_ruby":
require => Exec["install_ruby_install"],
command => "ruby-install ruby 2.2.0",
creates => "/opt/rubies/ruby-2.2.0"
}
exec { "install_ruby_install":
command => "/bin/bash -c 'cd /tmp && wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz && tar -xzvf ruby-install-0.5.0.tar.gz && cd ruby-install-0.5.0/ && make install'",
creates => "/usr/bin/ruby-install",
}
exec { "install_chruby":
command => "/bin/bash -c 'cd /tmp && wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz && tar -xzvf chruby-0.3.9.tar.gz && cd chruby-0.3.9/ && 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