ruby - Automatic RVM installation -
i trying have rvm , ruby installed in ubuntu 12 virtual machine without human interaction apart password prompts.
i created shell script works pretty fine until need utilize rvm itself.
i using multi-user installation.
#!/bin/bash -l mainuser=`whoami` echo "installing '${mainuser}'" echo "installing git..." sudo -s apt-get install --yes curl git-core echo "installing rvm..." \curl -l https://get.rvm.io | sudo bash -s stable echo "adding ${mainuser} rvm group..." sudo adduser $mainuser rvm newgrp rvm
from here things weird.. need load dvm source. want both script have source , user's bash_profile / bashrc. anyway.. know how manually, can't have done script. lastly code tried:
. "/usr/local/rvm/bin/rvm" rvm utilize ruby-head rubyversion=`rvm list | awk '/ruby-head/{print x;print};{x=$0}' | sed -n '/ruby-head/{g;1!p;};h' | awk -f ' ' '{print $1}'` rubytest=${rubyversion}@test rvm utilize $rubytest --create --default
the error this:
test.sh: 7: /usr/local/rvm/bin/rvm: syntax error: "(" unexpected (expecting "fi")
if seek utilize total path, this:
rvm=/usr/local/rvm/bin/rvm $rvm utilize ruby-head rubyversion=`$rvm list | awk '/ruby-head/{print x;print};{x=$0}' | sed -n '/ruby-head/{g;1!p;};h' | awk -f ' ' '{print $1}'` rubytest =${rubyversion}@test $rvm utilize $rubytest --create --default
i error instead:
rvm not function, selecting rubies 'rvm utilize ...' not work.
i clueless. why can't utilize /usr/local/rvm/bin/rvm
?
is there way execute source /etc/profile.d/rvm.sh
user script?
i not @ shell script , linux, appreciate references , examples give.
thanks!
update
i tried:
source "/usr/local/rvm/scripts/rvm"
... , it's variants. same error: "rvm not function".
rvm implemented shell function rather executable, why can't phone call /usr/local/rvm/bin/rvm itself.
quoting you, "is there way execute source /etc/profile.d/rvm.sh user script?"
have tried doing that? had similar install 1 time didn't work crontab (they have instructions on site scenario, couldn't create them work), , had -- source part of profile.d rvm.
ruby linux shell rvm
No comments:
Post a Comment