Skip to content

Instantly share code, notes, and snippets.

@jamiejackson
Created February 24, 2015 20:54
Show Gist options
  • Save jamiejackson/4e5451ed3381603ceaec to your computer and use it in GitHub Desktop.
Save jamiejackson/4e5451ed3381603ceaec to your computer and use it in GitHub Desktop.
Attempt at Installing RVM in Vagrant
...
==> default: GPG verified '/home/vagrant/.rvm/archives/rvm-1.26.10.tgz'
==> default: Upgrading the RVM installation in /home/vagrant/.rvm/
==> default: RVM PATH line found in /home/vagrant/.mkshrc /home/vagrant/.profile /home/vagrant/.bashrc /home/vagrant/.zshrc.
==> default: RVM sourcing line found in /home/vagrant/.profile /home/vagrant/.bash_profile /home/vagrant/.zlogin.
==> default: Upgrade of RVM in /home/vagrant/.rvm/ is complete.
==> default: # User,
==> default: #
==> default: # Thank you for using RVM!
==> default: # We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
==> default: #
==> default: # ~Wayne, Michal & team.
==> default: In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
==> default: Upgrade Notes:
==> default: * No new notes to display.
==> default: Checking requirements for ubuntu.
==> default: Requirements installation successful.
==> default: RVM reloaded!
==> default: bash: line 1: return: can only `return' from a function or sourced script
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
#!/usr/bin/env bash
[ "$0" = "$BASH_SOURCE" ] && v=own || v=sourced;
set -e
# set -x
description="Install RVM"
runfile_name="rvm_install2"
while :
do
case $1 in
--provisioned-dir=*)
provisioned_dir=${1#*=} # Delete everything up till "="
shift
;;
--) # End of all options
shift
break
;;
-*)
echo "WARN: Unknown option (ignored): $1" >&2
shift
;;
*) # no more options. Stop while loop
break
;;
esac
done
runfile="${provisioned_dir}/${runfile_name}"
echo "Preconfigure RVM"
echo "rvm_install_on_use_flag=1" >> $HOME/.rvmrc
echo "rvm_trust_rvmrcs_flag=1" >> $HOME/.rvmrc
echo "Install RVM"
#sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -L https://get.rvm.io | bash -s stable --autolibs=4
source "$HOME/.rvm/scripts/rvm"
[[ -s "$rvm_path/hooks/after_cd_bundle" ]] && chmod +x $rvm_path/hooks/after_cd_bundle
rvm autolibs enable
rvm requirements
rvm reload
touch "${runfile}"
$script = <<SCRIPT
su -c "source #{vm_script_dir}/utils/rvm_install2.sh \
--provisioned-dir=#{vm_provisioned_dir}
" vagrant
SCRIPT
# Install RVM
config.vm.provision "shell", inline: $script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment