gpt4 book ai didi

ruby - Octopress 包含代码崩溃

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:05:40 26 4
gpt4 key购买 nike

我使用 Octopress (jekyll) 作为博客引擎/生成器。当我在

中包含一段代码时
{% include_code foo.bar %}

语法,它完全崩溃了。如果我使用其他语法在标记内编写代码,也会发生这种情况

``` ruby
puts foo
```

但只有当我指定一种语言时。

我不知道如何解决它,stackoverflow 上的类似问题的答案 没有让我找到解决方案!修补 gems 没有用,用 RubyPython::Interpreter.configure 插入插件等等也没有用。

我正在运行 ArchLinux。

这是错误输出:

~/blog$ rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from /home/matthias/blog/_config.yml
/usr/lib/ruby/gems/1.9.1/gems/blankslate-3.1.2/lib/blankslate.rb:51: warning: undefining `object_id' may cause serious problems
Building site: source -> public
File "<string>", line 1
import sys; print sys.executable
^
SyntaxError: invalid syntax
sh: - : Ungültige Option
Benutzung: sh [Lange GNU Option] [Option] ...
sh [Lange GNU Option] [Option] Script-Datei ...
Lange GNU Optionen:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--protected
--rcfile
--restricted
--verbose
--version
Shell-Optionen:
-irsD oder -c Kommando (Nur Aufruf)
-abefhkmnptuvxBCHP oder Option -o
sh: - : Ungültige Option
Benutzung: sh [Lange GNU Option] [Option] ...
sh [Lange GNU Option] [Option] Script-Datei ...
Lange GNU Optionen:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--protected
--rcfile
--restricted
--verbose
--version
Shell-Optionen:
-irsD oder -c Kommando (Nur Aufruf)
-abefhkmnptuvxBCHP oder Option -o
/usr/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/lib/ffi/library.rb:121:in `block in ffi_lib': Could not open library 'lib.so': lib.so: cannot open shared object file: No such file or directory (LoadError)
from /usr/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `map'
from /usr/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/lib/ffi/library.rb:88:in `ffi_lib'
from /usr/lib/ruby/gems/1.9.1/gems/rubypython-0.5.3/lib/rubypython/python.rb:29:in `<module:Python>'
from /usr/lib/ruby/gems/1.9.1/gems/rubypython-0.5.3/lib/rubypython/python.rb:21:in `<top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/rubypython-0.5.3/lib/rubypython.rb:261:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/rubypython-0.5.3/lib/rubypython.rb:261:in `reload_library'
from /usr/lib/ruby/gems/1.9.1/gems/rubypython-0.5.3/lib/rubypython.rb:104:in `start'
from /usr/lib/ruby/gems/1.9.1/gems/pygments.rb-0.2.13/lib/pygments/ffi.rb:8:in `start'
from /usr/lib/ruby/gems/1.9.1/gems/pygments.rb-0.2.13/lib/pygments/ffi.rb:82:in `highlight'
from /home/matthias/blog/plugins/pygments_code.rb:24:in `pygments'
from /home/matthias/blog/plugins/pygments_code.rb:14:in `highlight'
from /home/matthias/blog/plugins/backtick_code_block.rb:37:in `block in render_code_block'
from /home/matthias/blog/plugins/backtick_code_block.rb:13:in `gsub'
from /home/matthias/blog/plugins/backtick_code_block.rb:13:in `render_code_block'
from /home/matthias/blog/plugins/octopress_filters.rb:12:in `pre_filter'
from /home/matthias/blog/plugins/octopress_filters.rb:28:in `pre_render'
from /home/matthias/blog/plugins/post_filters.rb:112:in `block in pre_render'
from /home/matthias/blog/plugins/post_filters.rb:111:in `each'
from /home/matthias/blog/plugins/post_filters.rb:111:in `pre_render'
from /home/matthias/blog/plugins/post_filters.rb:166:in `do_layout'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/post.rb:189:in `render'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/site.rb:193:in `block in render'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/site.rb:192:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/site.rb:192:in `render'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/lib/jekyll/site.rb:40:in `process'
from /usr/lib/ruby/gems/1.9.1/gems/jekyll-0.11.2/bin/jekyll:250:in `<top (required)>'
from /usr/bin/jekyll:19:in `load'
from /usr/bin/jekyll:19:in `<main>'
~/blog$

最佳答案

如果我将/usr/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.4/lib/pygments/mentos.py 的第一行更改为运行“python2”而不是“python”。

关于ruby - Octopress 包含代码崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13899848/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com