jekyll: Error: different prefix: "/" and "G:/"
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>'
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 38 (13 by maintainers)
FYI: I just rolled back to 3.1.6 and it works fine for me.
@sangimed
gem uninstall jekyll -v 3.2.0
gem install jekyll -v 3.1.6
@erikjohnsen Did you try 3.1.6?
@sasivarnan Tracking that in #5192
Thanks for working on this. I tried 3.2.0.pre.beta1, so here’s an update. I always get this error on Windows 10, regardless of the current directory. From the
N:\
(created via thesubst
command):and also from
C:\Users\Doug\Notes
(which works correctly under3.1.6
):3.2.0 can’t work but 3.1.6
@brutalcrozt when i used the version of jekyll 3.2.0.pre.beta1 ,I met an error above,my system is Windows 10 x64 too,So i decide to change the version and find that version 3.1.6 is okay
last stable at this time
3.1.6
but i got performance issue, not sure why? should i open new issue instead? 😄@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.)
It’s still happening with Jekyll v3.1.6.
@SuriyaaKudoIsc The subst command doesn’t allow a backslash for the first argument:
but it does automatically put it in:
Looks like a bug to me in Jekyll::Configuration.
/cc @jekyll/windows