Skip to content
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

cannot run jekyll serve (cannot load json) #261

Closed
ddd-workshop opened this issue Apr 13, 2016 · 6 comments
Closed

cannot run jekyll serve (cannot load json) #261

ddd-workshop opened this issue Apr 13, 2016 · 6 comments

Comments

@ddd-workshop
Copy link

On newly installed Fedora 23 with ruby 2.2.4 I cannot jekyll serve after bundle exec

$ bundle exec jekyll serve
Configuration file: /home/marcin/github/blog/_config.yml
            Source: /home/marcin/github/blog
       Destination: /home/marcin/github/blog/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
/home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/filters.rb:2:in `require': cannot load such file -- json (LoadError)
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/filters.rb:2:in `<top (required)>'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/convertible.rb:249:in `do_layout'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/page.rb:130:in `render'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:61:in `sitemap_content'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:54:in `block in write'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:54:in `open'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:54:in `write'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:20:in `generate'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/site.rb:154:in `block in generate'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/site.rb:153:in `each'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/site.rb:153:in `generate'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/site.rb:58:in `process'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/command.rb:26:in `process_site'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/commands/build.rb:60:in `build'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/commands/build.rb:33:in `process'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/lib/jekyll/commands/serve.rb:34:in `block (2 levels) in init_with_program'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.1/bin/jekyll:13:in `<top (required)>'
    from /home/marcin/bin/jekyll:23:in `load'
    from /home/marcin/bin/jekyll:23:in `<main>'
@ddd-workshop
Copy link
Author

more context:

$ ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]
$ bundle install
Using addressable 2.3.8
Using colorator 0.1
Using multipart-post 2.0.0
Using ffi 1.9.10
Using sass 3.4.21
Using rb-fsevent 0.9.7
Using kramdown 1.9.0
Using liquid 3.0.6
Using mercenary 0.3.5
Using rouge 1.10.1
Using safe_yaml 1.0.4
Using jekyll-sitemap 0.10.0
Using redcarpet 3.3.4
Using titlecase 0.1.1
Using bundler 1.11.2
Using octopress-deploy 1.3.0
Using faraday 0.9.2
Using rb-inotify 0.9.5
Using jekyll-sass-converter 1.4.0
Using sawyer 0.6.0
Using listen 3.0.5
Using octokit 4.2.0
Using jekyll-watch 1.3.1
Using jekyll-gist 1.4.0
Using jekyll 3.1.1
Using octopress-escape-code 2.1.1
Using octopress-hooks 2.6.1
Using octopress 3.0.11
Bundle complete! 4 Gemfile dependencies, 28 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

@mmistakes
Copy link
Owner

I've experienced this before too. It has something to do with one of the Jekyll plugin gems. Pretty sure it's jekyll-sitemap as indicated by your error log above.

Couple of things to try:

  • Update dependencies: bundle update
  • Run bundle exec jekyll serve --trace --verbose for more error info. Helpful for tracking down what file(s) it's barfing on and or what plugin is the culprit.

@ddd-workshop
Copy link
Author

updated:

$ bundle update
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using addressable 2.4.0 (was 2.3.8)
Using colorator 0.1
Using multipart-post 2.0.0
Using ffi 1.9.10
Using sass 3.4.22 (was 3.4.21)
Using rb-fsevent 0.9.7
Using kramdown 1.10.0 (was 1.9.0)
Using liquid 3.0.6
Using mercenary 0.3.6 (was 0.3.5)
Using rouge 1.10.1
Using safe_yaml 1.0.4
Using jekyll-sitemap 0.10.0
Using redcarpet 3.3.4
Using titlecase 0.1.1
Using bundler 1.11.2
Using octopress-deploy 1.3.0
Using faraday 0.9.2
Using rb-inotify 0.9.7 (was 0.9.5)
Using jekyll-sass-converter 1.4.0
Using sawyer 0.7.0 (was 0.6.0)
Using listen 3.0.6 (was 3.0.5)
Using octokit 4.3.0 (was 4.2.0)
Using jekyll-watch 1.3.1
Using jekyll-gist 1.4.0
Installing jekyll 3.1.2 (was 3.1.1)
Using octopress-escape-code 2.1.1
Using octopress-hooks 2.6.1
Using octopress 3.0.11
Bundle updated!

but it still fails:

$ bundle exec jekyll serve --trace --verbose
  Logging at level: debug
Configuration file: /home/marcin/github/blog/_config.yml
         Requiring: jekyll-sitemap
         Requiring: jekyll-gist
         Requiring: kramdown
            Source: /home/marcin/github/blog
       Destination: /home/marcin/github/blog/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       EntryFilter: excluded /README.md
       EntryFilter: excluded /Gemfile
       EntryFilter: excluded /package.json
       EntryFilter: excluded /LICENSE
       EntryFilter: excluded /Gemfile.lock
       EntryFilter: excluded /Gruntfile.js
           Reading: _posts/2016-03-08-hello.md
         Rendering: sitemap.xml
  Pre-Render Hooks: sitemap.xml
/home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/filters.rb:2:in `require': cannot load such file -- json (LoadError)
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/filters.rb:2:in `<top (required)>'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/convertible.rb:249:in `do_layout'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/page.rb:130:in `render'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:61:in `sitemap_content'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:54:in `block in write'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:54:in `open'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:54:in `write'
    from /home/marcin/.gem/ruby/gems/jekyll-sitemap-0.10.0/lib/jekyll-sitemap.rb:20:in `generate'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/site.rb:154:in `block in generate'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/site.rb:153:in `each'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/site.rb:153:in `generate'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/site.rb:58:in `process'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/command.rb:26:in `process_site'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/commands/build.rb:60:in `build'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/commands/build.rb:33:in `process'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/commands/serve.rb:34:in `block (2 levels) in init_with_program'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `call'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from /home/marcin/.gem/ruby/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from /home/marcin/.gem/ruby/gems/jekyll-3.1.2/bin/jekyll:13:in `<top (required)>'
    from /home/marcin/bin/jekyll:23:in `load'
    from /home/marcin/bin/jekyll:23:in `<main>'

after bundle update git diff looks like this:

diff --git a/Gemfile.lock b/Gemfile.lock
index 1683714..ad82a52 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,12 +1,12 @@


   specs:
-    addressable (2.3.8)
+    addressable (2.4.0)



     ffi (1.9.10)
-    jekyll (3.1.1)
+    jekyll (3.1.2)


       jekyll-watch (~> 1.1)
@@ -22,15 +22,15 @@


       listen (~> 3.0)
-    kramdown (1.9.0)
+    kramdown (1.10.0)
     liquid (3.0.6)
-    listen (3.0.5)
+    listen (3.0.6)
       rb-fsevent (>= 0.9.3)
-      rb-inotify (>= 0.9)
-    mercenary (0.3.5)
+      rb-inotify (>= 0.9.7)
+    mercenary (0.3.6)
     multipart-post (2.0.0)
-    octokit (4.2.0)
-      sawyer (~> 0.6.0, >= 0.5.3)
+    octokit (4.3.0)
+      sawyer (~> 0.7.0, >= 0.5.3)
     octopress (3.0.11)
       jekyll (>= 2.0)
       mercenary (~> 0.3.2)
@@ -46,14 +46,14 @@ GEM
     octopress-hooks (2.6.1)
       jekyll (>= 2.0)
     rb-fsevent (0.9.7)
-    rb-inotify (0.9.5)
+    rb-inotify (0.9.7)
       ffi (>= 0.5.0)
     redcarpet (3.3.4)
     rouge (1.10.1)
     safe_yaml (1.0.4)
-    sass (3.4.21)
-    sawyer (0.6.0)
-      addressable (~> 2.3.5)
+    sass (3.4.22)
+    sawyer (0.7.0)
+      addressable (>= 2.3.5, < 2.5)
       faraday (~> 0.8, < 0.10)
     titlecase (0.1.1)

@mmistakes
Copy link
Owner

jekyll-sitemap doesn't like something it appears since it all breaks down at

  Rendering: sitemap.xml
  Pre-Render Hooks: sitemap.xml
/home/marcin/.gem/ruby/gems/jekyll-3.1.2/lib/jekyll/filters.rb:2:in `require': cannot load such file -- json (LoadError)

Are you trying to run an unaltered version of the theme or have you added your own posts/pages? It's possible there's some YAML or something in the content it doesn't like.

Also I just released a huge update to the theme. Give that a go.

@mmistakes
Copy link
Owner

Also what's your _config.yml look like? I've seen the json error before when directories like node_modules isn't excluded properly in the config. Jekyll tries to read in those files and bad things start to happen.

@ddd-workshop
Copy link
Author

current version works, just on of the earlier ones was broken

sungmi67 added a commit to sungmi67/sungmi67.github.io that referenced this issue Jan 3, 2020
mmistakes#261 
post_archive:
  type: liquid
  path: /post/
theRealSuperMario pushed a commit to theRealSuperMario/therealsupermario.github.io that referenced this issue Jul 18, 2020
Added long description for pypi #minor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants