4

GitLab で .java (およびその他の) ファイルを表示しようとすると、次のエラーが発生します。

500: 申し訳ありませんが、問題が発生しました。

/home/git/gitlab/log/production.log:

Started GET "/xbjoernx/Project1/blob/master/src/de/xbjoernx/project1/NotificationRedirect.java" for  at 2013-07-02 12:00:44 +0200
Processing by BlobController#show as HTML
  Parameters: {"project_id"=>"xbjoernx/Project1", "id"=>"master/src/de/xbjoernx/project1/NotificationRedirect.java"}
  Rendered shared/_ref_switcher.html.haml (2.2ms)
  Rendered blob/_actions.html.haml (457.1ms)
  Rendered blob/_text.html.haml (482.3ms)
  Rendered blob/_blob.html.haml (972.0ms)
  Rendered blob/show.html.haml within layouts/project_resource (990.9ms)
Completed 500 Internal Server Error in 1020ms

ActionView::Template::Error (EPIPE):
    9:   .file_content.code
    10:     - unless blob.empty?
    11:       %div{class: user_color_scheme_class}
    12:         = raw blob.colorize(formatter: :gitlab)
    13:     - else
    14:       %p.nothing_here_message Empty file
  app/views/blob/_text.html.haml:12:in `_app_views_blob__text_html_haml__85795113__642493118'
  app/views/blob/_blob.html.haml:28:in `_app_views_blob__blob_html_haml__678936362__642626818'
  app/views/blob/show.html.haml:4:in `_app_views_blob_show_html_haml___279560956__642657458'
4

1 に答える 1

4

使用しているpythonにリンクされているようです:

blob.colorize 行の例外を伴う最後の 3 つの問題は、python を再インストール/更新するか、/usr/bin/envpython が >= 2.5 かつ < 3.0 であることを確認することで修正されました。次のバージョンには、そのためのチェックが含まれます。

第 2177 号にも示されています。

dzaporozhets:~/projects/ 
→ python -V
Python 2.7.2+

dzaporozhets:~/projects/ 
→ python2 -V
No command 'python2' found, did you mean:

問題 2214は次を追加します。

Python は 2.x と 3
の間で移行中であるため、これは問題です。問題は、一部のディストリビューションが既に出荷されている (またはデフォルトとして Python3 を出荷しようとしている) ため、Python が 2.x であることに依存することは危険なことです。したがって、python2 への切り替えは正しかったと思います。これは、すべてのケースで機能するように修正できるからです。

必要に応じて Python を修正する手順:

# Install Python
sudo apt-get install python

# Make sure that Python is 2.x (3.x is not supported at the moment)
python --version

# If it's Python 3 you might need to install Python 2 separately
sudo apt-get install python2.7

# Make sure you can access Python via `python2`
python2 --version
# If you get a "command not found" error create a link to the python binary
sudo ln -s /usr/bin/python /usr/bin/python2
于 2013-07-02T10:32:24.187 に答える