From 211a59532981406457a42303c8a4a2d201dc3aa8 Mon Sep 17 00:00:00 2001 From: ashmaroli Date: Fri, 22 Sep 2017 02:06:26 +0530 Subject: [PATCH] Don't break if bundler is not installed (#6377) Merge pull request 6377 --- lib/jekyll/commands/new.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/commands/new.rb b/lib/jekyll/commands/new.rb index b1c8bb0b..e784f24a 100644 --- a/lib/jekyll/commands/new.rb +++ b/lib/jekyll/commands/new.rb @@ -128,7 +128,12 @@ RUBY def after_install(path, options = {}) unless options["blank"] || options["skip-bundle"] - bundle_install path + begin + require "bundler" + bundle_install path + rescue LoadError + Jekyll.logger.info "Could not load Bundler. Bundle install skipped." + end end Jekyll.logger.info "New jekyll site installed in #{path.cyan}." @@ -136,7 +141,6 @@ RUBY end def bundle_install(path) - Jekyll::External.require_with_graceful_fail "bundler" Jekyll.logger.info "Running bundle install in #{path.cyan}..." Dir.chdir(path) do process, output = Jekyll::Utils::Exec.run("bundle", "install")