jekyll 3.0.0-beta error Is a directory # rb_sysopen - jekyll

With jekyll-2.5.3 I'm able to run "jekyll serve --watch" to generate my site and preview it. However, since upgrading to jekyll-3.0.0.pre.beta1 I now see the following error
jekyll serve --watch
Configuration file: /wrk/git/blog/_config.yml
Deprecation: Auto-regeneration can no longer be set from your configuration file(s). Use the --[no-]watch/-w command-line option instead.
Deprecation: The 'pygments' configuration option has been renamed to 'highlighter'. Please update your config file accordingly. The allowed values are 'rouge', 'pygments' or null.
Source: /wrk/git/blog
Destination: /wrk/git/blog/_site
Incremental build: enabled
Generating...
Build Warning: Layout 'nil' requested in atom.xml does not exist.
Build Warning: Layout 'nil' requested in rss.xml does not exist.
jekyll 3.0.0-beta1 | Error: Is a directory # rb_sysopen - /wrk/git/blog/_site/tech/2013/04/24/blog
I've checked and I have read/write/execute permissions, so I don't think it's a permission error. If it helps, here's my source and layout (https://github.com/minhongrails/blog), which has directories like _includes, _layouts, _posts, index.html, etc in the root directory.
Does anyone have any ideas how to resolve this? Thanks!

Build Warning: Layout 'nil' requested in atom.xml does not exist.
Build Warning: Layout 'nil' requested in rss.xml does not exist.
I think the layout should be null, not nill.

For some reason I needed to move my source files into a "source" subdirectory as specified in the _config.yml. Here's some of the _config.yml that I had to modify
source: src
# needed to also update this b/c it was generating inside the "source" dir
destination: _site
In Jekyll 2 I didn't need to do this but I guess it's now necessary in Jekyll 3? Here's a Github issue with more details: https://github.com/jekyll/jekyll/issues/3248

Related

Jekyll serve generate wrong path in localhost

I believe this is caued by gem "github-pages". When I run bundle exec jekyll serve, all the links is generated with a prefix of /pages/<user_name> or /pages/<user_name>/<repo_name> depends on repository in _config.yml.
For example, /js/jquery.js becomes /pages/<user_name>/js/jquery.js. This make all the JavaScript, CSS, and page broken.
However, it generates fine if it is built by GitHub. Also, if I remove repository in _config.yml cause the following error.
GitHub Metadata: Error processing value 'baseurl':
Liquid Exception: No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository. in /_layouts/layout.html
ERROR: YOUR SITE COULD NOT BE BUILT:
No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository.
Setting JEKYLL_ENV to development solved the problem.
On Windows, you can run the following:
set JEKYLL_ENV=development

Jekyll not finding blog posts

Source Code
I am new to Jekyll and got it installed with Grunt and SASS. My issues is that while my test site will show my new posts, When I click on the post link I get an error "Cannot GET /blog/example-post-name".
Grunt doesn't show any errors when running Grunt Serve. However if I run Jekyll serve I get the following errors:
Build Warning: Layout 'article' requested in app/_posts/2015-01-31-optimized-jekyll-site-with-grunt.markdown does not exist.
Build Warning: Layout 'article' requested in app/_posts/2017-03-20-welcome-to-jekyll.markdown does not exist.
Liquid Exception: Could not locate the included file 'blog.html' in any of ["/Users/rich/jekyll-site/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source. in app/index.html
jekyll 3.4.2 | Error: Could not locate the included file 'blog.html' in any of ["/Users/rich/jekyll-site/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source.
It appears that it cannot find anything in my: _includes, _layouts, ect... folders.
Any help would be appreciated.
Since your template files are in the app/ directory, simply build with app as the source directory.
Add the following to your _config.yml:
source: app
Then run jekyll serve as usual.
Try adding blog.html file in _includes folder or use layout: default in your posts 2015-01-31-optimized-jekyll-site-with-grunt.markdown etc.

error executing $jekyll serve --watch --baseurl ""

I want to make a blog using Jekyll , so have made a public repository in my github account and made gh-pages branch and set it to default branch and later deleted master branch . Also, I have made _config.yml file whose contents are as follows.
markdown:redcarpet
baseurl:/amar
exclude:['readme.md']
when I want to turn on Jekyll , using this command
$jekyll serve --watch --baseurl ""
I am getting this error
dhcp-54-132:amar Amar$ jekyll serve --watch --baseurl " "
WARNING: Error reading configuration. Using defaults (and options).
Configuration file: (INVALID) /Users/Amar/Documents/jekyll-blog/amar/_config.yml
Source: /Users/Amar/Documents/jekyll-blog/amar
Destination: /Users/Amar/Documents/jekyll-blog/amar/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.062 seconds.
Auto-regeneration: enabled for '/Users/Amar/Documents/jekyll-blog/amar'
WARNING: Error reading configuration. Using defaults (and options).
Configuration file: (INVALID) /Users/Amar/Documents/jekyll-blog/amar/_config.yml
Server address: http://127.0.0.1:4000 /
Server running... press ctrl-c to stop.
Can someone please help me, also as I am new to Jekyll , so please do not downvote me . Thanks in advance
There needs to be a space for the options and its values
markdown:redcarpet
should be
markdown: redcarpet
and so on in _config.yml file
There should be space after tags in .yml file, and this has to be done for all of the tags.

Excluding a directory from Jekyll watch

I'm using Jekyll 3.1.1 to generate a blog and I recently introduced a Git hook to automatically publish changes pre-push.
After introducing this hook, I have started getting the following error when I run jekyll serve:
Configuration file: /Users/egillespie/Projects/blog.givingjar.org/_config.yml
Source: /Users/egillespie/Projects/blog.givingjar.org
Destination: /Users/egillespie/Projects/blog.givingjar.org/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.223 seconds.
** ERROR: directory is already being watched! **
Directory: /Users/egillespie/Projects/blog.givingjar.org/node_modules/git-scripts/bin/hooks
is already being watched through: /Users/egillespie/Projects/blog.givingjar.org/node_modules/git-scripts/bin/hooks
MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
Auto-regeneration: enabled for '/Users/egillespie/Projects/blog.givingjar.org'
Configuration file: /Users/egillespie/Projects/blog.givingjar.org/_config.yml
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
What's peculiar is that I am excluding node_modules in _config.yml:
exclude:
- Gemfile
- Gemfile.lock
- LICENSE
- README.md
- package.json
- Gruntfile.js
- node_modules
node_modules is correctly being excluded from building (i.e. there is no node_modules subdirectory in _site).
I'm also excluding node_modules in .gitignore:
# project
node_modules
_site*
.sass-cache
.jekyll-metadata
# general
.DS_Store
Thumbs.db
ehthumbs.db
Based on this GitHub issue and this commit it seems like node_modules should be excluded from the watch, but it's not. I can't decipher from the documentation if there's another way to exclude files from the watch.
What is the proper way for me to exclude a directory from the watch and avoid the error described above?
The value for exclude parameter in _config.yml should be an array i.e.
exclude: ['_site', 'node_modules', ...]
Source: Jekyll Documentation - Configuration
Judging by the paths displayed in your output, you're on macOS. The jekyll-watch gem is responsible for this area (watch/rebuild features), which itself depends on the 'listen' gem. The listen gem itself uses the rb-inotify gem as a dependency, which has several issues with macOS specifically and its filesystem. This results in several bugs in regeneration behaviour that aren't not easy to fix. Background and relevant bugs:
https://github.com/guard/listen/issues/274
https://github.com/guard/listen/pull/273
You can try using the 'polling' method: https://github.com/guard/listen#listen-adapters instead, but it's much slower.
Try this to your _config.yml:
keep_files: [node]
where node is a folder to exclude from the --watch. What this will do is keeping the folder node untouched by jekyll build. Then add all files that you want to keep in the site root but not rendered by Jekyll.

Adding Jekyll to an existing website

I have a simple website and tried to add a Jekyll blog in it in a new folder blog thus I have run jekyll new blog in the folder /path. However when I'm running the command jekyll build in /path I have these errors:
$ jekyll build
Configuration file: none
Source: /path
Destination: /path/_site
Generating...
Build Warning: Layout 'post' requested in blog/_posts/2015-06-14-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'default' requested in blog/index.html does not exist.
Conversion error: Jekyll::Converters::Scss encountered an error converting 'blog/css/main.scss'.
Conversion error: File to import not found or unreadable: /blog/_sass/base.scss. Load paths: on line 47
I solved the first problem (Configuration file: none) by moving _config.ymlin the parent folder, however I still have problems when requesting layout using
---
layout: default
---
The imports in main.scssare also not working (last error).
If I'm doing the same command jekyll build in /path/blogafter moving again _config.yml, I have no errors. Does someone know how to be able to do a jekyll buildin the parent folder with the configuration I have? Do I have to entirely change the architecture of my website to include a Jekyll blog in it?
You config.yml is in /path with
source: /_jekyll
destination: /blog
baseurl: /blog
Your jekyll sources are in /path/_jekyll.
And you generated files will be in /path/blog.
Ready to deploy !