Description
What version of Jekyll are you using (jekyll -v
)?
jekyll 3.0.3
What operating system are you using?
Windows 10 x64
What did you do?
Being a lazy developer I got tired of typing a long path to my GitHub repository where I run Jekyll, so I created a script to run at login time that uses the subst
command to associate a drive letter with the path:
subst G: E:\<long-path>\GitHub\dbc60.github.io
Now I can just type G:
in my console and be instantly transported to my repo. Unfortunately Jekyll crashes with an error about different prefixes.
That said, there is a simple workaround for the problem described below. I can set G:
to the parent directory and cd
to the repo before running Jekyll. It's just that the crash was surprising, so I thought you should know about it.
Anyway, here's what I did. I ran bundle exec jekyll s --drafts
What did you expect to see?
I expected something like:
G:\> bundle exec jekyll s --trace
Configuration file: G:/_config.yml
Source: G:/
Destination: G:/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 4.408 seconds.
Auto-regeneration: enabled for 'G:/'
Configuration file: G:/_config.yml
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
What did you see instead?
Here's the error output:
G:\> bundle exec jekyll s --drafts
Configuration file: /_config.yml
Source: G:/
Destination: G:/_site
Incremental build: disabled. Enable with --incremental
Generating...
jekyll 3.0.3 | Error: different prefix: "/" and "G:/"
I reran the command with the --trace
option:
G:\> bundle exec jekyll s --trace
Configuration file: /_config.yml
Source: G:/
Destination: G:/_site
Incremental build: disabled. Enable with --incremental
Generating...
E:/Apps/Ruby22/lib/ruby/2.2.0/pathname.rb:508:in `relative_path_from': different prefix: "/" and "G:/" (ArgumentError)
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/document.rb:93:in `relative_path'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/document.rb:85:in `draft?'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/document.rb:27:in `initialize'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/readers/post_reader.rb:55:in `new'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/readers/post_reader.rb:55:in `block in read_content'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/readers/post_reader.rb:52:in `map'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/readers/post_reader.rb:52:in `read_content'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/readers/post_reader.rb:35:in `read_publishable'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/readers/post_reader.rb:25:in `read_posts'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/reader.rb:59:in `retrieve_posts'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/reader.rb:46:in `read_directories'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/reader.rb:17:in `read'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/site.rb:144:in `read'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/site.rb:57:in `process'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/command.rb:28:in `process_site'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/commands/build.rb:60:in `build'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/commands/build.rb:35:in `process'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
from E:/Apps/Ruby22/lib/ruby/gems/2.2.0/gems/jekyll-3.0.3/bin/jekyll:17:in `<top (required)>'
from E:/Apps/Ruby22/bin/jekyll:23:in `load'
from E:/Apps/Ruby22/bin/jekyll:23:in `<main>'
Activity
parkr commentedon Mar 19, 2016
Looks like a bug to me in Jekyll::Configuration.
/cc @jekyll/windows
envygeeks commentedon Mar 19, 2016
It's a bug in Pathname, Pathname does simplistic checking for performance and it's not very Windows friendly. "G:/" doesn't match "/" so it will always fail unless G:\ is the root of Windows (then it really is a bug.) I'll be on Windows tomorrow working on some unrelated stuff so I'll run Pry and see what I can come up with an replicate independent of Jekyll so we can figure out if we can fix this problem easily or not.
suriyaa commentedon Apr 3, 2016
@envygeeks is right. 👍
Using Pathname on Windows isn't the best idea.
@dbc60 Try to use this command:
dbc60 commentedon Apr 6, 2016
@SuriyaaKudoIsc The subst command doesn't allow a backslash for the first argument:
but it does automatically put it in:
jekyllbot commentedon Jun 6, 2016
This issue has been automatically marked as stale because it has not been commented on for at least
three months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If you can still reproduce this error on the
3.1-stable
ormaster
branch,please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider building it first as a plugin. Jekyll 3 introduced
hooks which provide convenient access points throughout
the Jekyll build pipeline whereby most needs can be fulfilled. If this is something that cannot be
built as a plugin, then please provide more information about why in order to keep this issue open.
Thank you for all your contributions.
envygeeks commentedon Jun 6, 2016
This isn't stale, this is an actual bug in Pathname that Pathutil will be trying to solve for Jekyll.
dbc60 commentedon Jun 6, 2016
It's still happening with Jekyll v3.1.6.
envygeeks commentedon Jun 6, 2016
@dbc60 it will happen until I either make sure Pathutil doesn't have this bug also and fix it and then move our stuff to Pathutil the rest of the way or, Pathname suddenly decides to fix it (doubtful since they've been told before.)
26 remaining items
soFlyMan commentedon Aug 1, 2016
I get the same issue.My English is poor.Can somebody tell me is there any solution?
jake-low commentedon Aug 1, 2016
@soFlyMan: Try this:
soFlyMan commentedon Aug 1, 2016
@jake-low Thank you,I have solved the problem.
erikjohnsen6d commentedon Aug 1, 2016
@parkr I can test, but not sure how to install a gem from source code like that.
parkr commentedon Aug 3, 2016
3.2.1 should fix this for you! http://jekyllrb.com/news/2016/08/02/jekyll-3-2-1-released/
sasivarnan commentedon Aug 3, 2016
Thanks for the fix.
I am facing another issue. I am getting the following error when I try to do
jekyll serve
orbundle exec jekyll serve
.I already tried
gem cleanup
andbundle install
. I am still getting the same error.parkr commentedon Aug 3, 2016
@sasivarnan Tracking that in #5192