Jekyll - 跑步错误&Jekyll Serve'

时间:2014-01-15 12:11:37

标签: ruby gem jekyll

编辑:找到答案(请参阅下面的答案!)。它涉及使用版本1.4.2而不是1.4.3,所以如果有人对1.4.3工作有任何想法,那也可能有用。谢谢!

编辑2:感谢下面的评论,似乎1.4.3在Windows上运行时确实存在问题。 https://github.com/jekyll/jekyll/issues/1948

我刚在Windows 7计算机上安装了jekyll。我和开发包一起安装了ruby。

我已经运行gem install jekyll并且成功完成了。我根据jekyll文档创建了一个新站点。

当我尝试运行jekyll serve时,遇到了我遇到的问题。请在下面找到错误输出。

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)>

我环顾四周但是我是红宝石的新手,所以我不知道该寻找什么或如何在这里找到错误。任何帮助都会非常有用。

谢谢,

3 个答案:

答案 0 :(得分:39)

回答我自己的问题,我设法找到了解决方案。

这似乎是Jekyll版本1.4.3的问题。为了解决这个问题,我卸载了jekyll并安装了1.4.2版本。

gem uninstall jekyll

gem install jekyll --version "=1.4.2"

如果您在Windows上遇到与我相同的问题,那么一切都应该可以正常工作。

我想这是因为版本1.4.3是新的(在13日发布)并且在Windows上不稳定。

答案 1 :(得分:0)

Jekyll的插件“类别档案生成器”(https://github.com/shigeya/jekyll-category-archive-plugin

遇到了同样的问题

很可能你有一个插件 - 在_plugins文件夹中 - 使用File.join()方法。例如File.join('/', dest, @dir, @category_dir_name, 'index.html')

通过删除带有File.join(dest, @dir, @category_dir_name, 'index.html')

的第一个元素来修改此项

答案 2 :(得分:0)

我在Ubuntu Precise 12.04上遇到了同样的问题。问题是我安装了ruby1.8。我也安装了ruby1.9.1。我删除了ruby1.8,然后Jekyll安装得很好。