Created
February 24, 2015 20:54
-
-
Save jamiejackson/4e5451ed3381603ceaec to your computer and use it in GitHub Desktop.
Attempt at Installing RVM in Vagrant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
==> 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. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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