1 # frozen_string_literal: true
7 def initialize(options)
12 Bundler.settings.set_command_option_if_given :path, options[:path]
14 definition = Bundler.definition
15 definition.validate_runtime!
18 definition.resolve_only_locally!
19 not_installed = definition.missing_specs
20 rescue GemNotFound, SolveFailure
21 Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
22 Bundler.ui.warn "Install missing gems with `bundle install`."
27 Bundler.ui.error "The following gems are missing"
28 not_installed.each {|s| Bundler.ui.error " * #{s.name} (#{s.version})" }
29 Bundler.ui.warn "Install missing gems with `bundle install`"
31 elsif !Bundler.default_lockfile.file? && Bundler.frozen_bundle?
32 Bundler.ui.error "This bundle has been frozen, but there is no #{SharedHelpers.relative_lockfile_path} present"
35 Bundler.load.lock(preserve_unknown_sections: true) unless options[:"dry-run"]
36 Bundler.ui.info "The Gemfile's dependencies are satisfied"