#!/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) source_dir="${source_dir:-`dirname $0 | xargs dirname`}" if [ ! -d "$source_dir" ] ; then unset source_dir ; fi source_dir="${source_dir:-$cwd}" 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 echo -e "\n\033[0;32m\033[0m Ensuring that rvm script location in $file is scripts/rvm not bin/rvm for: ~/.bash_profile, ~/.bashrc, ~/.zshrc" for file in ~/.bash_profile ~/.bashrc ~/.zshrc ; do if [ -s $file ] ; then 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;32m\033[0m Removing old rvm file from ~/.rvm/bin/rvm" rm -f ~/.rvm/bin/rvm fi for dir in config scripts examples ; do mkdir -p $rvm_dir/$dir for file in `/bin/ls $source_dir/$dir/`; do cp $source_dir/$dir/$file $rvm_dir/$dir/$file done done system=`uname` if [ "$system" = "Linux" ] ; then rvm_apt_get_binary=`which apt-get 2> /dev/null` rvm_emerge_binary=`which emerge 2> /dev/null` rvm_pacman_binary=`which pacman 2> /dev/null` rvm_yum_binary=`which yum 2> /dev/null` 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 ruby gems are now all installed into ~/.rvm/gems" echo -e "\n$info Please visit the website for much more information: http://rvm.beginrescueend.com/\n" echo ' w⦿‿⦿t! ' echo -e "\n ~ Wayne" source $rvm_dir/scripts/rvm rvm symlinks echo rvm -v