New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank new blog generated with Jekyll-3.2.1 on Windows #5192

Closed
ashmaroli opened this Issue Aug 3, 2016 · 25 comments

Comments

Projects
None yet
@ashmaroli
Copy link
Member

ashmaroli commented Aug 3, 2016

  • I believe this to be a bug, not a question about using Jekyll.
  • I Updated to the latest Jekyll 3.2.1

  • I am on (or have tested on) _Windows_ 7
  • I am running Ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]

  • I was trying to create a new blog.

My Reproduction Steps

$ jekyll new my_blog
$ cd my_blog
$ bundle install
$ bundle exec jekyll s
(--redacted--)
generating...
D:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/default.html: No such file or directory @ rb_sysopen - /RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/default.html
D:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/page.html: No such file or directory @ rb_sysopen - /RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/page.html
D:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/post.html: No such file or directory @ rb_sysopen - /RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/post.html
  done in 0.702 seconds.
  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?
(--redacted--)
  Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

When I point my browser to http://localhost:4000/, all I see is a blank page

The Output I Wanted

http://localhost:4000/ to show my_blog/index.html rendered with minima-1.0.1 theme

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Aug 3, 2016

Where are your gems installed to? What permissions are those directories? It's possible that you installed with sudo and Jekyll doesn't have permissions to read those files.

/cc @benbalter

@ashmaroli

This comment has been minimized.

Copy link
Member

ashmaroli commented Aug 3, 2016

My gems are set to path, so they can be accessed from anywhere on the windows machine.
I'm on an Administrator account, so full access to all files/folders.
sudo doesn't exist in windows. Just Run as Administrator

Edits:
I tried creating and serving a new blog using cmd.exe with 'Run as Administrator'. No success.
I tried again by uninstalling minima and re-installing using gem install. No success.

Why I think this is a version-specific bug:

  • The files said to be missing in my first post above actually exists within the minima gem files.
  • I had earlier successfully created a blog using Jekyll 3.1.6

The issue-4677 present in J3.2.0 was fixed in 3.2.1

@ashmaroli

This comment has been minimized.

Copy link
Member

ashmaroli commented Aug 3, 2016

If at least one other windows user reports the same problem, please assign this issue a bug label and windows label.

@envygeeks

This comment has been minimized.

Copy link
Contributor

envygeeks commented Aug 3, 2016

Windows is reported yet those are very specific and common Linux paths in the log. Regardless of the "/" that is clearly something looking in a Linux path. There is a bigger problem somewhere if this can be replicated and it might not originate in Jekyll?

@sasivarnan

This comment has been minimized.

Copy link

sasivarnan commented Aug 3, 2016

I am also facing the same issue, in command prompt (windows 10 - 64 bit )
I already tried gem cleanup and bundle install.
I am getting the same error when I try to do jekyll serve or bundle exec jekyll serve.

@ashmaroli

This comment has been minimized.

Copy link
Member

ashmaroli commented Aug 3, 2016

Where are your gems installed to?

@parkr, I've updated my original post to include the entire path as shown in the logs. Now, it should be easier to troubleshoot..

Specifically, the absence of the drive letter after @ rb_sysopen

D:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/default.html: No such file or directory @ rb_sysopen - /RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/default.html

@ashmaroli

This comment has been minimized.

Copy link
Member

ashmaroli commented Aug 3, 2016

Update:
_If I copy the layouts folder from minima gem to the root of the blog, I get the Output I wanted. Everything works like with Jekyll 3.1.6

@benbalter

This comment has been minimized.

Copy link
Contributor

benbalter commented Aug 3, 2016

I suspect this is going to be traced to this line, either File.realpath (used to resolve symlinks) or the subsequent Jekyll.sanitized_path call.

@ashmaroli

This comment has been minimized.

Copy link
Member

ashmaroli commented Aug 3, 2016

But whats puzzling is why is it a bug for only _layouts instead of also _includes, and _sass

@mmistakes

This comment has been minimized.

Copy link

mmistakes commented Aug 3, 2016

Hitting something similar with 3.2.1 on Windows.

jekyll new test-site
cd test-site
bundle install

bundle exec jekyll build

Error reading file C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/minima-1.0.1/_layouts/default.html: No such file or directory
 - /Ruby200-x64/lib/ruby/gems/2.0.0/gems/minima-1.0.1/_layouts/default.html
Error reading file C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/minima-1.0.1/_layouts/page.html: No such file or directory -
/Ruby200-x64/lib/ruby/gems/2.0.0/gems/minima-1.0.1/_layouts/page.html
Error reading file C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/minima-1.0.1/_layouts/post.html: No such file or directory -
/Ruby200-x64/lib/ruby/gems/2.0.0/gems/minima-1.0.1/_layouts/post.html

Because the path to _layouts doesn't resolve correctly posts and pages that spit out are blank.

Update: The layout files appear to be in the location that the error is saying No such file or directory. Really strange.

folders

@ashmaroli

This comment has been minimized.

Copy link
Member

ashmaroli commented Aug 3, 2016

@mmistakes, The solution may lie in solving the mystery behind the missing drive letter after @ rb_sysopen - in the raises.

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Aug 3, 2016

@ashmaroli I think you're right – it's the missing drive letter. IIRC, Jekyll.sanitized_path removes the drive letter. We have a test for this on AppVeyor I think (script/default-site), so we should be able to replicate the issue there (I hope).

@ashmaroli

This comment has been minimized.

Copy link
Member

ashmaroli commented Aug 4, 2016

I added some changes to my local copy of Jekyll 3.2.1 based on #5195 and ran bundle exec jekyll s --verbose to check if the layouts_path had the drive letter dropped..

$ bundle exec jekyll s --verbose

  Logging at level: debug
Configuration file: C:/Jekyll Sites/my_blog/_config.yml
             Theme: minima
      Theme Source: D:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1
    Layouts Source: D:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts
         Requiring: kramdown
            Source: C:/Jekyll Sites/my_blog
       Destination: C:/Jekyll Sites/my_blog/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
Error reading file D:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/default.html: 
No such file or directory @ rb_sysopen - /RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/default.html
Error reading file D:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/page.html: 
No such file or directory @ rb_sysopen - /RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/page.html
Error reading file D:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/post.html: 
No such file or directory @ rb_sysopen - /RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layouts/post.html
... ...

So, I suspect the bug lies within layout_reader.rb bcoz the blog renders properly if the _layouts folder is additionally copied to blog root (debug still shows the layout sourced from minima, though)

@ashmaroli

This comment has been minimized.

Copy link
Member

ashmaroli commented Aug 4, 2016

Temporary Fix

I have traced that missing drive letter to site.in_theme_dir(base, name) in layouts.rb
In light of that I've come up with a rudimentary workaround to this issue:

# lib/jekyll/layout.rb
# Replace Line 38 with:

@path = base + "/" + name

@ashmaroli ashmaroli referenced this issue Aug 5, 2016

Closed

fix theme layout-path for Windows #5202

3 of 3 tasks complete
@sasivarnan

This comment has been minimized.

Copy link

sasivarnan commented Aug 7, 2016

@ashmaroli Thanks for the workaround.

@ashmaroli

This comment has been minimized.

Copy link
Member

ashmaroli commented Aug 7, 2016

@sasivarnan you're welcome 😃

@parkr parkr added this to the 3.2.2 milestone Aug 11, 2016

@envygeeks

This comment has been minimized.

Copy link
Contributor

envygeeks commented Aug 12, 2016

@patrickbense There is no "_layouts" because Jekyl uses Gem based themes now. That is not a bug.

@patrickbense

This comment has been minimized.

Copy link

patrickbense commented Aug 12, 2016

Oops, I deleted my comment before I saw your response. Thanks @envygeeks, my bad!

@mvaneijgen

This comment has been minimized.

Copy link

mvaneijgen commented Aug 13, 2016

@envygeeks is there somewhere explained how everything works now? Because I like to overwrite certain layouts and includes, but I have no Idea where they are or how to edit them.

@DirtyF

This comment has been minimized.

Copy link
Member

DirtyF commented Aug 13, 2016

@mvaneijgen it is supposed to be detailed on https://jekyllrb.com/docs/themes/ but I guess it's hard to know what files to overwrite without seeing the default structure. 'bundle show minima`may help before you add your own files to Jekyll's root directory in order to overwrite them.

@sandys

This comment has been minimized.

Copy link

sandys commented Aug 15, 2016

+1 - this is the same issue we are facing. we are unable to create a new blog because of this :(

@benbalter benbalter changed the title Blank new blog generated with Jekyll-3.2.1 Blank new blog generated with Jekyll-3.2.1 on Windows Aug 15, 2016

kwokfu added a commit to kwokfu/jekyll that referenced this issue Aug 18, 2016

Proposed fix for jekyll#5192
Strip drive name only when necessary.

kwokfu added a commit to kwokfu/jekyll that referenced this issue Aug 26, 2016

@rrongcheng

This comment has been minimized.

Copy link

rrongcheng commented Aug 28, 2016

+1 I got same issue on my win8.1, and get it works now via the temporary fix provided by ashmaroli. Thanks @ashmaroli!

@lgh06

This comment has been minimized.

Copy link

lgh06 commented Aug 31, 2016

the same issue
Error reading file C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layout s/default.html: No such file or directory @ rb_sysopen - /tools/ruby23/lib/ruby/ gems/2.3.0/gems/minima-1.0.1/_layouts/default.html Error reading file C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layout s/page.html: No such file or directory @ rb_sysopen - /tools/ruby23/lib/ruby/gem s/2.3.0/gems/minima-1.0.1/_layouts/page.html Error reading file C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/minima-1.0.1/_layout s/post.html: No such file or directory @ rb_sysopen - /tools/ruby23/lib/ruby/gem s/2.3.0/gems/minima-1.0.1/_layouts/post.html
windows 10 64bit cmd.exe

@lgh06

This comment has been minimized.

Copy link

lgh06 commented Aug 31, 2016

copy _layouts directory works for me...
I would use Mac instead....

@benbalter

This comment has been minimized.

Copy link
Contributor

benbalter commented Aug 31, 2016

This is being worked on, and should be fixed by #5256.

reservedwords added a commit to reservedwords/reservedwords.github.io that referenced this issue Sep 4, 2016

Copy layouts locally to work around bug
Paths to layouts don't resolve on Windows. See [jekyll/jekyll#5192. Copying layouts locally gets around it until an upstream fix is issued.

@parkr parkr modified the milestones: 3.2.2, 3.3 Sep 22, 2016

@parkr parkr referenced this issue Sep 23, 2016

Closed

Jekyll 3.3 Release Gameplan #5400

9 of 9 tasks complete

@parkr parkr closed this Oct 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment