diff --git a/attributes/default.rb b/attributes/default.rb index eaf31934..2f250ccf 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -45,7 +45,7 @@ default['rvm']['user_installs'] = [] # system-wide installer options -default['rvm']['installer_url'] = "https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer" +default['rvm']['installer_url'] = "https://get.rvm.io" default['rvm']['branch'] = "stable" default['rvm']['version'] = "head" default['rvm']['upgrade'] = "none" diff --git a/libraries/chef_rvm_recipe_helpers.rb b/libraries/chef_rvm_recipe_helpers.rb index 5aa679a3..57217a8c 100644 --- a/libraries/chef_rvm_recipe_helpers.rb +++ b/libraries/chef_rvm_recipe_helpers.rb @@ -24,6 +24,7 @@ module RVM module RecipeHelpers def build_script_flags(version, branch) script_flags = "" + script_flags += " -s --" if version or branch script_flags += " --version #{version}" if version script_flags += " --branch #{branch}" if branch script_flags @@ -59,21 +60,16 @@ def install_rvm(opts = {}) if opts[:user] user_dir = opts[:rvm_prefix] exec_name = "install user RVM for #{opts[:user]}" - exec_env = { 'USER' => opts[:user], 'HOME' => user_dir } + exec_env = { 'USER' => opts[:user], 'HOME' => user_dir, 'TERM' => 'dumb' } else user_dir = nil exec_name = "install system-wide RVM" - exec_env = nil + exec_env = { 'TERM' => 'dumb' } end - i = bash exec_name do + i = execute exec_name do user opts[:user] || "root" - code <<-EOH - RVM_INSTALL=`mktemp` - curl -s #{opts[:installer_url]} > $RVM_INSTALL - bash $RVM_INSTALL #{opts[:script_flags]} - rm $RVM_INSTALL - EOH + command "curl -L #{opts[:installer_url]} | bash #{opts[:script_flags]}" environment(exec_env) # excute in compile phase if gem_package recipe is requested