From 8b69c6f0b5ad8c6d94c782c559028db4985a4704 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Thu, 28 Jul 2016 15:12:31 -0400 Subject: [PATCH] resolve theme root before sanitizing --- lib/jekyll/theme.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/theme.rb b/lib/jekyll/theme.rb index e402ec05..0dd73f78 100644 --- a/lib/jekyll/theme.rb +++ b/lib/jekyll/theme.rb @@ -10,7 +10,11 @@ module Jekyll end def root - @root ||= gemspec.full_gem_path + # Must use File.realpath to resolve symlinks created by rbenv + # Otherwise, Jekyll.sanitized path with prepend the unresolved root + @root ||= File.realpath(gemspec.full_gem_path) + rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP + nil end def includes_path