Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added nice warning message about using gemsets with System rubies.

  • Loading branch information...
commit c4fd4db993790410ac6c7d22760821559e9dc52b 1 parent 9ba2ec0
@wayneeseguin wayneeseguin authored
Showing with 12 additions and 1 deletion.
  1. +3 −0  scripts/manage
  2. +9 −1 scripts/utility
View
3  scripts/manage
@@ -817,6 +817,9 @@ __rvm_remove_ruby() {
if [[ -e $rvm_bin_path/$rvm_ruby_string ]] ; then
rm -f $rvm_bin_path/$rvm_ruby_string
fi
+ if grep -q "$rvm_ruby_string" "$rvm_config_path/default" ; then
+ rm -f "$rvm_config_path/default"
+ fi
done ; unset dir
__rvm_remove_gemsets
else
View
10 scripts/utility
@@ -643,6 +643,11 @@ __rvm_gemset_select() {
rvm_ruby_global_gems_path="$rvm_gems_path/${rvm_ruby_string}${rvm_gemset_separator}global"
+ if [[ -z "$(echo $GEM_HOME | grep "$rvm_path")" ]] ; then
+ $rvm_scripts_path/log "error" "Gemsets cannot be used with system ruby installs (yet)."
+ return 1
+ fi
+
if [[ -z "$rvm_gemset_name" ]] ; then
# No longer defaulting to 'sticky' gem sets.
# Set 'rvm_sticky_flag=1' in ~/.rvmrc to enable.
@@ -715,7 +720,10 @@ __rvm_gemset_select() {
# Use a gemset specified by 'rvm_ruby_gem_home'
__rvm_gemset_use() {
- if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
+ if [[ -z "$(echo $GEM_HOME | grep "$rvm_path")" ]] ; then
+ $rvm_scripts_path/log "error" "Gemsets cannot be used with system ruby installs (yet)."
+ return 1
+ elif [[ ! -z "$rvm_ruby_gem_home" ]] ; then
if [[ ! -d "$rvm_ruby_gem_home" ]] ; then
if [[ "$rvm_gemset_create_on_use_flag" -eq 1 ]] || [[ "$rvm_create_flag" -eq 1 ]]; then
$rvm_scripts_path/gemsets create $rvm_gemset_name
Please sign in to comment.
Something went wrong with that request. Please try again.