class Bundler::CLI
def install(path = nil)
def install(path = nil) opts = options.dup opts[:without] ||= [] opts[:without].map! { |g| g.to_sym } # Can't use Bundler.settings for this because settings needs gemfile.dirname ENV['BUNDLE_GEMFILE'] = opts[:gemfile] if opts[:gemfile] Bundler.settings[:path] = path if path Bundler.settings[:disable_shared_gems] = '1' if options["disable-shared-gems"] Bundler.settings.without = opts[:without] remove_lockfiles if options[:relock] begin Installer.install(Bundler.root, Bundler.definition, opts) rescue GemfileChanged raise GemfileChanged, "You changed your Gemfile after locking. " + "Please run `bundle install --relock`." end Bundler.ui.confirm "Your bundle is complete! " + "Use `bundle show [gemname]` to see where a bundled gem is installed." lock if options[:relock] cache if Bundler.root.join("vendor/cache").exist? rescue GemNotFound => e if Bundler.definition.sources.empty? Bundler.ui.warn "Your Gemfile doesn't have any sources. You can add one with a line like 'source :gemcutter'" end raise e end