diff --git a/scripts/gems b/scripts/gems index 528c5d6ad8..465c10f9ed 100755 --- a/scripts/gems +++ b/scripts/gems @@ -214,13 +214,17 @@ __rvm_gem_install() { fi if [[ ! -z "$gem" ]] ; then + + gem_action="$(echo $gem_args | awk '{print $1}')" + gems_args="$(echo $gem_args | awk '{$1="" ; print}' | sed 's/^[ \t]*//')" + # TODO: Set vars if fourth field is non-empty (means that there are conditional statements to execute in the gem install line. if [[ "rvm_make_flags_flag" -eq 1 ]] ; then __rvm_make_flags ; fi if [[ ! -z "$rvm_ruby_gem_home" ]] && [[ "$rvm_ruby_gem_home" != "$rvm_gems_path" ]] ; then - command="GEM_HOME='$rvm_ruby_gem_home' GEM_PATH='$rvm_ruby_gem_home/bin:$rvm_gems_path/$rvm_ruby_string%global/bin' $gem_prefix gem $gems_args $rvm_gem_options $gem $gem_postfix $vars" + command="GEM_HOME='$rvm_ruby_gem_home' GEM_PATH='$rvm_ruby_gem_home/bin:$rvm_gems_path/$rvm_ruby_string%global/bin' $gem_prefix gem $gem_action $gems_args $rvm_gem_options $gem $gem_postfix $vars" else - command="$gem_prefix gem $gems_args $rvm_gem_options -q $gem $gem_postfix $vars" + command="$gem_prefix gem $gem_action $gems_args $rvm_gem_options -q $gem $gem_postfix $vars" fi __rvm_run "gem.install" "$command" "$gem_name $gem_version is not installed, installing..." result=$? @@ -229,7 +233,7 @@ __rvm_gem_install() { else $rvm_scripts_path/log "error" "$color_red$gem_name $gem_version$color_none failed to install, output has been logged to:\n$rvm_path/log/$rvm_ruby_string/gem.install.error.log" fi - fi ; unset gem gem_prefix gem_name gem_version gem_file_name gem_postfix cache_file gem_file_name gem_string + fi ; unset gem gem_prefix gem_name gem_version gem_file_name gem_postfix cache_file gem_file_name gem_string gem_action gem_args return $result } diff --git a/scripts/log b/scripts/log index c86311d880..adbceee816 100755 --- a/scripts/log +++ b/scripts/log @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi +if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi if [[ ! -z "$2" ]] ; then level=$1 ; shift ; else level="info" ; fi