#!/bin/bash user=`whoami` if [ "$user" = "root" ] ; then echo -e "\033[0;31m \033[0mroot user support is not implemented yet.\033[0m" exit 1 fi cwd=$(pwd) rvm_dir=~/.rvm info="\n\033[0;32m\033[0m" echo -e "$info Updating rvm source ~/.rvm/scripts/rvm ..." for dir in src scripts bin log archives config gems examples ; do mkdir -p $rvm_dir/$dir done for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do if [ -s $file ] ; then echo -e "\n\033[0;33m\033[0m Ensuring that rvm script location in $file is scripts/rvm not bin/rvm" sed -i.orig 's/rvm\/bin\/rvm/rvm\/scripts\/rvm/g' $file fi done if [ -f ~/.rvm/bin/rvm ] ; then echo -e "\n\033[0;33m\033[0m Removing old rvm file from ~/.rvm/bin/rvm" rm -f ~/.rvm/bin/rvm fi for dir in scripts examples ; do mkdir -p $rvm_dir/$dir for file in `/bin/ls $dir/`; do cp $cwd/$dir/$file $rvm_dir/$dir/$file done done system=`uname` if [ "$system" = "Linux" ] ; then rvm_apt_get_binary=`which apt-get` rvm_emerge_binary=`which emerge` rvm_pacman_binary=`which pacman` rvm_yum_binary=`which yum` echo -e "\033[0;33m \033[0mFor jRuby & ree (if you wish to use it) you will need:" if [ ! -z "$rvm_apt_get_binary" ] ; then echo -e "\033[0;32m \033[0msudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk libreadline5-dev libssl-dev " elif [ ! -z "$rvm_emerge_binary" ] ; then echo -e "\033[0;32m \033[0msudo emerge dev-java/sun-jdk dev-java/sun-jre-bin" elif [ ! -z "$rvm_pacman_binary" ] ; then echo -e "\033[0;32m \033[0msudo pacman -Sy jdk jre" elif [ ! -z "$rvm_yum_binary" ] ; then echo -e "\033[0;32m \033[0myum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..." else echo -e "\033[0;32m \033[0mThe SUN java runtime environment and development kit." fi elif [ "$sytem" = "Darwin" ] ; then echo -e "\033[0;32m \033[0mIf you intend on installing MacRuby you must install LLVM first." fi echo -e "$info There have been a great many updates since previous releases, please:" echo -e "$info * remove sourcing of ~/.rvm/current from your shell profiles." echo -e "$info * note that gems are now all pulled into ~/.rvm/gems/" echo -e "\n Thank you, come again! \n" echo -e " ~ Wayne" source $rvm_dir/scripts/rvm rvm symlinks echo rvm -v