scripts/rvm in rvm-0.0.33 vs scripts/rvm in rvm-0.0.34

- old
+ new

@@ -9,11 +9,11 @@ # function __rvm_meta { rvm_meta_author="Wayne E. Seguin" rvm_meta_author_email="wayneeseguin@gmail.com" rvm_meta_website="http://rvm.beginrescueend.com/" - rvm_meta_version="0.0.33" + rvm_meta_version="0.0.34" rvm_meta_updated="2009.09.04" } function __rvm_version { __rvm_meta ; echo "rvm $rvm_meta_version ($rvm_meta_updated) [$rvm_meta_website]" ; } @@ -162,17 +162,27 @@ fi if [ -s $rvm_install_path/default_user_gem_path ] ; then rvm_default_user_gem_path=`cat $rvm_install_path/default_user_gem_path` else - ruby -r rubygems -e "puts Gem::default_path.compact.first" > $rvm_install_path/default_user_gem_path + which ruby > /dev/null + if [ $? -ne 0 ] ; then + __rvm_log "info" "System ruby not found, assuming no system installed ruby." + else + ruby -r rubygems -e "puts Gem::default_path.compact.first" > $rvm_install_path/default_user_gem_path + fi fi if [ -s $rvm_install_path/default_system_gem_path ] ; then rvm_default_system_gem_path=`cat $rvm_install_path/default_system_gem_path` else - ruby -r rubygems -e "puts Gem::default_path.compact[1] || Gem::default_path.compact.first" > $rvm_install_path/default_system_gem_path + which ruby > /dev/null + if [ $? -ne 0 ] ; then + __rvm_log "info" "System ruby not found, assuming no system installed ruby." + else + ruby -r rubygems -e "puts Gem::default_path.compact[1] || Gem::default_path.compact.first" > $rvm_install_path/default_system_gem_path + fi fi if [ -s $rvm_install_path/default_system_ruby ] ; then default_system_ruby=`cat $rvm_install_path/default_system_ruby` else @@ -247,11 +257,11 @@ # function __rvm_run { log_file_name="1" ; shift command="$*" if [ $rvm_debug ] ; then __rvm_log "debug" "Executing: $command" ; fi - eval "nice -n $rvm_niceness $command" > $rvm_ruby_log_path/log_file_name.log 2> $rvm_ruby_log_path/log_file_name.error.log - if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/log_file_name.error.log" ; popd 2> /dev/null ; return 1 ; fi + eval "nice -n $rvm_niceness $command" > $rvm_ruby_log_path/$log_file_name.log 2> $rvm_ruby_log_path/$log_file_name.error.log + if [ $? -gt 0 ] ; then __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/$log_file_name.error.log" ; popd 2> /dev/null ; return 1 ; fi unset log_file command } function __rvm_install-source {