lib/rconf/configurators/bundler_configurator.rb in rconf-0.6.15 vs lib/rconf/configurators/bundler_configurator.rb in rconf-0.6.16

- old
+ new

@@ -73,14 +73,19 @@ report_check('Uninstalling existing versions of bundler') Command.execute('gem', 'uninstall', 'bundler', '-a', '-x') report_success end report_check("Installing bundler #{version}") - gem_path DEFAULT_GEM_PATH unless gem_path - bundler_file = File.join(gem_path, "bundler-#{version}.gem") - report_fatal("Missing bundler gem at #{bundler_file}") unless File.exist?(bundler_file) - res = Command.execute('gem','install', bundler_file, '--no-ri', '--no-rdoc', - :abort_on_failure => 'Failed to install bundler') + if gem_path + bundler_file = [ File.join(gem_path, "bundler-#{version}.gem") ] + report_fatal("Missing bundler gem at #{bundler_file}") unless File.exist?(bundler_file) + else + bundler_file = [ 'bundler', '-v', version ] + end + options = [ 'gem','install' ] + options += bundler_file + options += [ '--no-ri', '--no-rdoc', :abort_on_failure => 'Failed to install bundler' ] + res = Command.execute(*options) report_success true end end