Created
May 6, 2011 15:42
-
-
Save jmahowald/959197 to your computer and use it in GitHub Desktop.
Bootrsap of RVM
This file contains hidden or 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
cat <<'BOOTSTRAP_AS_USER' > /home/$app_user/bootstrap_as_user.sh | |
set -e | |
bash < <( curl --insecure https://rvm.beginrescueend.com/install/rvm ) | |
rvm_include_string='[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' | |
grep "$rvm_include_string" ~/.bashrc || echo "$rvm_include_string" >> ~/.bashrc | |
cat <<'RVMRC_CONTENTS' > ~/.rvmrc | |
rvm_install_on_use_flag=1 | |
rvm_trust_rvmrcs_flag=1 | |
rvm_gemset_create_on_use_flag=1 | |
RVMRC_CONTENTS | |
BOOTSTRAP_AS_USER | |
chmod a+x /home/$app_user/bootstrap_as_user.sh | |
su - $app_user /home/$app_user/bootstrap_as_user.sh | |
------ | |
su - $app_user | |
$rvm_path (/usr/local/rvm) does not exist. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmmm, just came across this when trying to solve this problem and the code looked very familiar. I tried your fix but couldn't get it to work for me, and I'm a fan of the install on use flag so the bootstrap script can stay as generic as possible. I've got a fix that seems to work, I'll push it as soon as I'm a little more confident in it.