Table of Contents

Install Ruby

mkdir /home/vault/ruby && cd /home/vault/ruby
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh && rvm install 2.2.1 && rvm use 2.2.1 --default && gem install bundler monitor daemons

Ruby script from within a bash script - Will not start at startup

 

#! /bin/bash

export GEM_HOME=/usr/local/rvm/gems/ruby-2.2.1
export GEM_PATH=/usr/local/rvm/gems/ruby-2.2.1:/usr/local/rvm/gems/ruby-2.2.1@global
export PATH=/usr/local/rvm/gems/ruby-2.2.1/bin:$PATH:/usr/local/rvm/rubies/ruby-2.2.1/bin:/usr/local/rvm/bin
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then

# First try to load from a user install
source "$HOME/.rvm/scripts/rvm"

elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then

# Then try to load from a root install
source "/usr/local/rvm/scripts/rvm"

else

printf "ERROR: An RVM installation was not found.\n"

fi

rvm use 2.2.1

 

Second Header

  • No labels