Jekyll没有生成_sites文件夹

时间:2012-08-30 03:19:53

标签: ruby gem yaml jekyll

我正在为一位朋友开发网站,之前从未使用过Jekyll或Ruby。我分叉了他的github项目,虽然它花了我一段时间我最终得到了Jekyll(我认为)正确安装,一切似乎都在工作。我对该项目进行了分支并将其作为分支工作,并且在某些时候它随机停止生成_site文件夹,尽管我无法将其链接到任何特定的内容。我切换回主分支,它仍然无法正常工作。我在_config.yml文件中关闭了自动重新生成,然后我开始收到以下错误:

/Users/SamGavisHughson/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/psych.rb:148:in `parse':couldn't parse YAML at line 16 column 0 (Psych::SyntaxError)  
from /Users/SamGavisHughson/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'  
from /Users/SamGavisHughson/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/psych.rb:119:in `parse'  
from /Users/SamGavisHughson/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/psych.rb:106:in `load'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:33:in `read_yaml'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/page.rb:24:in `initialize'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/site.rb:140:in `new'
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll 0.11.2/lib/jekyll/site.rb:140:in `block in read_directories'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/site.rb:130:in `each'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/site.rb:130:in `read_directories'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/site.rb:135:in `block in read_directories'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/site.rb:130:in `each'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/site.rb:130:in `read_directories'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/site.rb:98:in `read'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/lib/jekyll/site.rb:38:in `process'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/gems/jekyll-0.11.2/bin/jekyll:250:in `<top (required)>'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/bin/jekyll:19:in `load'   
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/bin/jekyll:19:in `<main>'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `eval'  
from /Users/SamGavisHughson/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `<main>'  

我在另一篇文章(Rails error, couldn't parse YAML)上看到他们提到改变了config / boot.rb中的内容,但我不知道如何做到这一点,所以如果有人能解释如何做到这一点,2解释为什么这个错误如此突然出现,或3.建议另一个解决方案,我将非常感激!

这是_config.yml文件,但我不认为这是问题,因为它在我更改之前就停止了工作:

permalink: pretty
auto: false
server: true

3 个答案:

答案 0 :(得分:2)

运行jekyll --no-auto --server将打印错误消息,说明您无法生成_site目录的原因。如果有帮助,请告诉我

答案 1 :(得分:0)

当您编辑它以关闭自动重新生成时,您很可能在_config.yml中引入了语法错误。尝试修复它,或者使用文件内容更新您的问题,以便此处有人可以查看它。

答案 2 :(得分:0)

我删除了我的仓库并再次分割了原件,只是重新编写了我的工作,它似乎正在工作,至少现在直到我弄乱别的东西;)