class Bundler::Installer
def install_gem_from_spec(spec, standalone = false, worker = 0)
def install_gem_from_spec(spec, standalone = false, worker = 0) # Fetch the build settings, if there are any settings = Bundler.settings["build.#{spec.name}"] messages = nil if settings Bundler.rubygems.with_build_args [settings] do messages = spec.source.install(spec) end else messages = spec.source.install(spec) end install_message, post_install_message, debug_message = *messages if install_message.include? 'Installing' Bundler.ui.confirm install_message else Bundler.ui.info install_message end Bundler.ui.debug debug_message if debug_message Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}" if Bundler.settings[:bin] && standalone generate_standalone_bundler_executable_stubs(spec) elsif Bundler.settings[:bin] generate_bundler_executable_stubs(spec, :force => true) end post_install_message rescue Errno::ENOSPC raise Bundler::InstallError, "Your disk is out of space. Free some " \ "space to be able to install your bundle." rescue Exception => e # if install hook failed or gem signature is bad, just die raise e if e.is_a?(Bundler::InstallHookError) || e.is_a?(Bundler::SecurityError) # other failure, likely a native extension build failure Bundler.ui.info "" Bundler.ui.warn "#{e.class}: #{e.message}" msg = "An error occurred while installing #{spec.name} (#{spec.version})," msg << " and Bundler cannot continue." unless spec.source.options["git"] msg << "\nMake sure that `gem install" msg << " #{spec.name} -v '#{spec.version}'` succeeds before bundling." end Bundler.ui.debug e.backtrace.join("\n") raise Bundler::InstallError, msg end