3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/escualo/bootstrap.rb', line 3
def self.install_ruby(ssh, options)
ssh.shell.perform! 'apt-get purge libruby* -y', options
if options.with_rbenv
ssh.shell.perform! %q{
curl https://raw.githubusercontent.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash &&
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc &&
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
}, options
ssh.shell.perform! 'rbenv install 2.3.1 && rbenv global 2.3.1 && rbenv rehash', options
else
ssh.shell.perform! %Q{
apt-get install software-properties-common -y &&
apt-add-repository '#{Escualo::PPA.for 'brightbox/ruby-ng'}' &&
apt-get update &&
apt-get install -y ruby2.3 ruby2.3-dev
}, options
end
end
|