Sha256: 5880e4616e6ff6ccc2fbfa2767e4931798e68f1492c5c1244013912fd41d2ff0

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 Bytes

Contents

#!/usr/bin/env bash

# Install ruby 1.9.3
#
# Options:
# * $RUBY_VERSION - override ruby version to test/install
# * $UPGRADE - re-install or upgrade ruby if already installed

set -e # exit immediately if a simple command exits with a non-zero status

if [[ $EUID -ne 0 ]]; then
  echo "ERROR: This script must be run as root" 1>&2
  exit 1
fi

RUBY_VERSION=ruby-1.9.3

if [[ "$(which ruby)" == "" || "${UPGRADE}X" != "X" || ! ("$(ruby -v)" =~ "ruby 1.9.3") ]]; then
  curl -L https://get.rvm.io | bash -s head --autolibs=3 --ruby=$RUBY_VERSION
  source /etc/profile.d/rvm.sh
else
  echo $RUBY_VERSION already installed
fi

sudo usermod -a -G rvm vcap

if [[ $(grep 'rvm $RUBY_VERSION --default' ~vcap/.profile) == "" ]]; then
  echo "setting rvm default for ~vcap user"
  echo "rvm $RUBY_VERSION --default" >> ~vcap/.profile
fi

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bosh-bootstrap-0.10.2 lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_ruby
bosh-bootstrap-0.10.1 lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_ruby
bosh-bootstrap-0.10.0 lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_ruby
bosh-bootstrap-0.9.0 lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_ruby