简体   繁体   中英

Jekyll - Error Running 'Jekyll Serve'

EDIT: Found the answer (see my answer below!). It involves using version 1.4.2 instead of 1.4.3, so if anyone has any ideas on getting 1.4.3 working, that could be helpful as well. Thanks!

EDIT 2: Thanks to a comment below, it seems that 1.4.3 does have a problem when running on windows. https://github.com/jekyll/jekyll/issues/1948

I have just setup jekyll on my windows 7 computer. I have ruby installed along with the dev pack.

I have run gem install jekyll and that completed with success. I have created a new site as per the jekyll documentation.

The problem I am experiencing happens when I try to run jekyll serve . Please find below the error output.

PS C:\jekyll\test-site> jekyll serve --trace
Configuration file: C:/jekyll/test-site/_config.yml
        Source: C:/jekyll/test-site
   Destination: C:/jekyll/test-site/_site
  Generating... C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Invalid argument - C:/jekyll/test-site/_site/C: (Errno::EINVAL)
    from C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
    from C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
    from C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
    from C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
    from C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:205:in `each'
    from C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/convertible.rb:168:in `write'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:259:in `block in write'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:397:in `block (2 levels) in each_site_file'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:396:in `each'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:396:in `block in each_site_file'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:395:in `each'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:395:in `each_site_file'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:259:in `write'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/site.rb:41:in `process'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/command.rb:18:in `process_site'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/commands/build.rb:23:in `build'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/lib/jekyll/commands/build.rb:7:in `process'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.3/bin/jekyll:97:in `block (2 levels) in <top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/runner.rb:402:in `run_active_command'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/runner.rb:78:in `run!'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/delegates.rb:11:in `run!'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/import.rb:10:in `block in <top (required)>

I have looked around but am a novice with ruby, so I have no idea what to look for or how to find the error here. Any help would be much appriciated.

Thanks,

Joe

Answering my own question, I managed to find a solution.

This appears to be a problem with Jekyll version 1.4.3. To fix the issue I uninstalled jekyll and installed version 1.4.2.

gem uninstall jekyll

gem install jekyll --version "=1.4.2"

Doing this and everything should work fine if you have the same issue as me on windows.

I guess this is because version 1.4.3 is new (released on 13th) and is unstable on windows.

Just came across the same issue with Jekyll's plugin "Category Archive Generator" ( https://github.com/shigeya/jekyll-category-archive-plugin )

Most likely you have a plugin - in the _plugins folder - which is using the File.join() method. eg File.join('/', dest, @dir, @category_dir_name, 'index.html')

Modify this by deleting the first element leaving you with File.join(dest, @dir, @category_dir_name, 'index.html')

I had the same problem on Ubuntu Precise 12.04. The issue was that I had ruby1.8 installed. I also had ruby1.9.1 installed. I removed ruby1.8, and then Jekyll installed fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM