lib/rconf/configurators/ruby_configurator.rb in rconf-0.8.30 vs lib/rconf/configurators/ruby_configurator.rb in rconf-0.9.4
- old
+ new
@@ -12,11 +12,11 @@
module RightConf
class RubyConfigurator
# RVM version used to install rubies
- RVM_VERSION = '1.6.2'
+ RVM_VERSION = '1.10.2'
# RVM releases URL
RVM_RELEASES_URL = 'https://rvm.beginrescueend.com/releases'
include Configurator
@@ -57,11 +57,11 @@
report_success
check_rvmrc
else
report_failure
report_check("Switching to #{version}")
- out = Command.execute('rvm', 'use', version).output
+ out = Command.execute('rvm', 'use', version, :env => { 'rvm_is_not_a_shell_function' => '0' }).output
case out
when /is not installed\./
report_failure
report_fatal "Failed to install #{ruby}" if @tried
Platform.dispatch(version) { :install_ruby }
@@ -89,11 +89,12 @@
Command.execute_in_ruby('gem', 'install', 'rconf')
report_success
end
report_check("Switching to gemset #{gemset}")
Command.execute('rvm', version, 'exec', 'rvm', 'gemset', 'use', gemset,
- :abort_on_failure => "Failed to switch to gemset '#{gemset}'")
+ :abort_on_failure => "Failed to switch to gemset '#{gemset}'",
+ :env => { 'rvm_is_not_a_shell_function' => '0' })
report_success
end
if rubygems
report_check("Checking whether rubygems #{rubygems} is installed")
res = Command.execute_in_ruby('gem', '--version')
@@ -279,22 +280,22 @@
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
then
. "${rvm_path:-$HOME/.rvm}/hooks/after_use"
- fi
+ fi
else
# If the environment file has not yet been created, use the RVM CLI to select.
if ! rvm --create "$environment_id"
then
echo "Failed to create RVM environment '${environment_id}'."
return 1
- fi
+ fi
fi
if [[ $- == *i* ]] # check for interactive shells
then
echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
-else
+else
echo "Using: $GEM_HOME" # don't use colors in interactive shells
fi
EOF
# Setup .bashrc for rvm support