2013-01-07 70 views
7

建立我嘗試做這樣的事情Octopress code blockOctopress不能與代碼塊

但我不能使它發揮作用。

它總是顯示以下錯誤。我的機器是Windows 7.

$ rake generate 
## Generating Site with Jekyll 
unchanged sass/screen.scss 
Configuration from d:/MyProject/Git/octopress/_config.yml 
Building site: source -> public 
Liquid Exception: No such file or directory - python c:/Ruby193/lib/ruby/gems/1. 
9.1/gems/pygments.rb-0.3.7/lib/pygments/mentos.py in 2013-01-06-octopress.markdo 
wn 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162:in 
`spawn' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162:in 
`spawn' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:307:in 
`popen4' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:41:i 
n `start' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:203: 
in `mentos' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:192: 
in `highlight' 
d:/MyProject/Git/octopress/plugins/pygments_code.rb:24:in `pygments' 
d:/MyProject/Git/octopress/plugins/pygments_code.rb:14:in `highlight' 
d:/MyProject/Git/octopress/plugins/code_block.rb:82:in `render' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:94:in `bloc 
k in render_all' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `coll 
ect' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `rend 
er_all' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:82:in `rend 
er' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:124:in ` 
render' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:132:in ` 
render!' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/convertible.rb:79:i 
n `do_layout' 
d:/MyProject/Git/octopress/plugins/post_filters.rb:167:in `do_layout' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/post.rb:195:in `ren 
der' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:200:in `blo 
ck in render' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:199:in `eac 
h' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:199:in `ren 
der' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:41:in `proc 
ess' 
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/bin/jekyll:264:in `<top (requi 
red)>' 
c:/Ruby193/bin/jekyll:23:in `load' 
c:/Ruby193/bin/jekyll:23:in `<main>' 
Build Failed 

沒有代碼塊,它工作正常。我已經安裝了Python 2.73和3.3的窗口,但不是運氣。

我也試過pygments 0.3.7和rubypython 0.6.3。它不起作用。

有趣的是我谷歌時間和小時,我沒有看到任何人有同樣的問題。

我必須錯過一些非常簡單的事情。

回答

7

我終於解決了這個問題。事實證明Python的PATH設置不正確。

看起來像Python不會自動設置路徑。

我要做的就是添加路徑。

+1

您可能還需要重新啓動命令提示符 –

+1

謝謝@maxisam。對我而言,這是由於Python版本不兼容而導致的。工作組合:Jekyll 2.0 vs Ruby200 vs Python27。罪魁禍首是Python33的道路上。 – MFIhsan