From 6849d6a5e5e7a97c8e196af4ca2215e5ae2dfdda Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 30 May 2014 17:59:47 -0400 Subject: [PATCH] If rouge isn't there, say so. In the previous version, it would say 'redcarpet' wasn't installed, due to the rescue LoadError block on line 93. This change will tell the user that, in fact, rouge isn't installed and that this is the cause of the error, not that redcarpet isn't installed. Fixes #2464. https://github.com/jekyll/jekyll/issues/2464 --- lib/jekyll/converters/markdown/redcarpet_parser.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/converters/markdown/redcarpet_parser.rb b/lib/jekyll/converters/markdown/redcarpet_parser.rb index df18327b..2c5bb2f8 100644 --- a/lib/jekyll/converters/markdown/redcarpet_parser.rb +++ b/lib/jekyll/converters/markdown/redcarpet_parser.rb @@ -67,8 +67,15 @@ module Jekyll end when 'rouge' Class.new(Redcarpet::Render::HTML) do - require 'rouge' - require 'rouge/plugins/redcarpet' + begin + require 'rouge' + require 'rouge/plugins/redcarpet' + rescue LoadError => e + Jekyll.logger.error "You are missing the 'rouge' gem. Please run:" + Jekyll.logger.error " $ [sudo] gem install rouge" + Jekyll.logger.error "Or add 'rouge' to your Gemfile." + raise FatalException.new("Missing dependency: rouge") + end if Rouge.version < '1.3.0' abort "Please install Rouge 1.3.0 or greater and try running Jekyll again."