2015-08-14 54 views
2

我剛剛在Windows上安裝了Jekyll,我正在嘗試使語法突出顯示工作與胭脂。Jekyll for GitHub頁面無法在Windows上找到胭脂

我在_config.yml上設置了highlighter: rouge

在\ 2015-08-13-my-first-post.md我得到的文件_posts:

{% highlight javascript linenos %} 
var s = "JavaScript syntax highlighting"; 
alert(s); 
{% endhighlight %} 

當我運行bundle exec jekyll serve它輸出:

C:\Users\Fred\Documents\Projects\GithubPage>bundle exec jekyll serve 
Configuration file: C:/Users/Fred/Documents/Projects/GithubPage/_config.yml 
      Source: C:/Users/Fred/Documents/Projects/GithubPage 
     Destination: C:/Users/Fred/Documents/Projects/GithubPage/_site 
     Generating... 
    Liquid Exception: cannot load such file -- rouge in _posts/2015-08-13-my-first-post.md 
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/tags/highlight.rb:103:in `require': cannot load such file -- rouge (LoadError) 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/tags/highlight.rb:103:in `render_rouge' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/tags/highlight.rb:54:in `render' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/liquid-2.6.3/lib/liquid/block.rb:109:in `block in render_all' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/liquid-2.6.3/lib/liquid/block.rb:96:in `each' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/liquid-2.6.3/lib/liquid/block.rb:96:in `render_all' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/liquid-2.6.3/lib/liquid/block.rb:82:in `render' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/liquid-2.6.3/lib/liquid/template.rb:128:in `render' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/liquid-2.6.3/lib/liquid/template.rb:138:in `render!' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/convertible.rb:106:in `render_liquid' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/convertible.rb:233:in `do_layout' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/post.rb:261:in `render' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:298:in `block in render' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:297:in `each' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:297:in `render' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:51:in `process' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program' 
     from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>' 
     from C:/Ruby21-x64/bin/jekyll:23:in `load' 
     from C:/Ruby21-x64/bin/jekyll:23:in `<main>' 

的寶石,我已經安裝了:

C:\Users\Fred\Documents\Projects\GithubPage>gem list --local 

*** LOCAL GEMS *** 

bigdecimal (1.2.4) 
blankslate (2.1.2.4) 
bundler (1.10.6) 
celluloid (0.16.1) 
classifier-reborn (2.0.3) 
coffee-script (2.4.1) 
coffee-script-source (1.9.1.1) 
colorator (0.1) 
execjs (2.5.2) 
fast-stemmer (1.0.2) 
ffi (1.9.10 x64-mingw32) 
hitimes (1.2.2) 
io-console (0.4.3) 
jekyll (2.5.3) 
jekyll-coffeescript (1.0.1) 
jekyll-gist (1.3.0) 
jekyll-paginate (1.1.0) 
jekyll-sass-converter (1.3.0) 
jekyll-watch (1.2.1) 
json (1.8.1) 
kramdown (1.8.0) 
liquid (2.6.3) 
listen (2.10.1) 
mercenary (0.3.5) 
minitest (4.7.5) 
parslet (1.5.0) 
posix-spawn (0.3.11) 
psych (2.0.5) 
pygments.rb (0.6.3) 
rake (10.1.0) 
rb-fsevent (0.9.5) 
rb-inotify (0.9.5) 
rdoc (4.1.0) 
redcarpet (3.3.2) 
rouge (1.9.1) 
safe_yaml (1.0.4) 
sass (3.4.16) 
test-unit (2.1.6.0) 
timers (4.0.1) 
toml (0.1.2) 
yajl-ruby (1.2.1) 
+0

我剛剛收到一封來自GitHub的自動電子郵件,聲稱GitHub頁面不支持胭脂。看來這可能是問題,除了安裝Python和pygments之外,我別無選擇。 無論如何,誰能告訴我,如果這是胭脂不在我的開發機器上工作的原因?也許是因爲我在使用GitHub軟件包。任何人都可以證實嗎? – fredzvt

+0

對於未來的讀者:請參閱[此問題](https://github.com/github/pages-gem/pull/79)。 –

回答

0

Github Pages只能用於these插件以確保安全兒子。

你在你的Jekyll目錄中安裝了胭脂嗎?

Here是在Jekyll語法突出顯示並在Windows機器上安裝Jekyll可能會幫助你的指南。

2

我有同樣的問題。我增加了行

gem 'rouge' 

我的Gemfile,然後跑

bundle install 

然後我可以運行

bundle exec jekyll build 

沒有錯誤。