undefined方法`highlight'Python + Pygments

时间:2011-11-09 18:57:15

标签: python ruby-on-rails-3 pygments

我在RHEL 6 i386上使用python 2.6.6Pygments version 1.4,但在尝试在gitlabhq中创建新项目时总是收到此错误消息。

宝石列表显示:pygments.rb (0.2.3)rubypython (0.5.1)等。

运行rails s -e production后,我在stdout中看到以下错误。 首先发生此错误:

Completed 500 Internal Server Error in 595ms

ActionView::Template::Error (Could not open library 'lib.so': lib.so: cannot open shared     object file: No such file or directory):
1: <% bash_lexer = Pygments::Lexer[:bash] %>
2: <div class="">
3:   <div class="git-empty">
4:     <h2>Git global setup:</h2>
app/views/projects/empty.html.erb:1:in   
`_app_views_projects_empty_html_erb___391147148_103534650'
app/controllers/projects_controller.rb:66:in `show'

然后我看到了:

ActionView::Template::Error (undefined method `highlight' for nil:NilClass):
7: git config --global user.email  "#{current_user.email}"
8: eos
9: %>
10:     <%= raw bash_lexer.highlight(setup_str) %>
11:     <br />
12:     <br />
13:     <h2>Next steps:</h2>
app/views/projects/empty.html.erb:10:in `_app_views_projects_empty_html_erb___460979452__619384988'
app/controllers/projects_controller.rb:66:in `show'

1 个答案:

答案 0 :(得分:1)

链接器错误,修复:yum install python-devel