After upgrade to 3.0.1 from 2.6 everything seems to work fine except viewing source files. For example, when I try to open ruby file from gitlab repo I get following:
Started GET "/gitlab/tree/master/app/models/ability.rb" for 123.117.161.175 at 2012-10-24 04:32:40 +0400Processing by TreeController#show as HTML Parameters: {"project_id"=>"gitlab", "id"=>"master/app/models/ability.rb"} Rendered shared/_ref_switcher.html.haml (2.3ms) Rendered tree/_head.html.haml (4.3ms) Rendered tree/_blob_actions.html.haml (60.2ms) Rendered tree/blob/_text.html.haml (316.8ms) Rendered tree/_blob.html.haml (403.8ms) Rendered tree/_tree.html.haml (407.1ms) Rendered tree/show.html.haml within layouts/project_resource (412.3ms)Completed 500 Internal Server Error in 483msActionView::Template::Error (Failed to get header.): 10: - unless blob.empty? 11: %div{class: current_user.dark_scheme ? "black" : "white"} 12: = preserve do 13: = raw blob.colorize(options: { linenos: 'True'}) 14: - else 15: %h4.nothing_here_message Empty file app/models/tree.rb:5:in `colorize' app/views/tree/blob/_text.html.haml:13:in `block in _app_views_tree_blob__text_html_haml___286653145_97900110' app/views/tree/blob/_text.html.haml:12:in `_app_views_tree_blob__text_html_haml___286653145_97900110' app/views/tree/_blob.html.haml:9:in `_app_views_tree__blob_html_haml__842558020_96336160' app/views/tree/_tree.html.haml:15:in `_app_views_tree__tree_html_haml___92957615_96221490' app/views/tree/show.html.haml:3:in `_app_views_tree_show_html_haml__1679662_93786340' app/controllers/tree_controller.rb:17:in `show'
This only happens for source code files. Markdown files are showing great.
I guess this have something to do with "linguist" or ruby pygments wrapper.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
In Gentoo Server and Ubuntu Server all works OK BUT in Centos5 Server I have the same bug. Problem is that This Centos5 Server with GITLAB is the most important one and no chance to upgrade in near future :(.
I know that you only support Debian/Ubuntu but this time with this log I don't see how to solve this problem myself. I'm not Ruby programmer and is very hard for me.
Please help.
Sorry for my bad English
By Administrator on 2012-10-26T14:07:38 (imported from GitLab)
same issue on redhat 2.6.18-128.7.1.el5 though I installed python2.6
I found pygments always use /usr/bin/python even if another higher python installed and PATH included it.
modify pygments.rb-0.3.1/lib/pygments/mentos.py can fix it:
change #!/usr/bin/python to #!/usr/bin/env python or #!/usr/bin/python2.6
By Administrator on 2012-11-01T06:10:15 (imported from GitLab)
Changing the shebang to run with python2 works. This is a pygments issue where they're not specifying python2...at this point, "python" is just as likely to refer to python 3 than 2. >_>
By Administrator on 2012-11-02T19:56:11 (imported from GitLab)
I had the same problem (on CentOS 5.5) upgrading to python 2.7 solved the problem for me. I've used the following github script to do it. https://github.com/scalp42/python-2.7.x-on-Centos-5.x The only thing I had to do manually afterwards was symlinking /usr/bin/python to the new 2.7 binary: ln -s python2.7 python
By Administrator on 2012-11-05T08:52:50 (imported from GitLab)
I had the same problem (on CentOS 5.5) upgrading to python 2.7 solved the problem for me. I've used the following github script to do it. https://github.com/scalp42/python-2.7.x-on-Centos-5.x The only thing I had to do manually afterwards was symlinking /usr/bin/python to the new 2.7 binary: ln -s python2.7 python
—
Reply to this email directly or view it on GitHub.

By Administrator on 2012-11-05T13:51:58 (imported from GitLab)
@danielkummer I'd be careful of doing that if other programs in your system are expecting /usr/bin/python to link to the python3 binary instead of python2.7. If you notice weird behavior, I'd change the symlink back to python3 and edit the mentos.py file as @zzzhc pointed to. That fixed it for me.
By Administrator on 2012-11-05T14:20:01 (imported from GitLab)
@sbtkd85, Of cource, but sadly (or gladly) Centos 5.5 ships with python 2.4 - no problems there...
However if your default python is python 3, as you mentioned DON'T DO IT
By Administrator on 2012-11-05T14:22:33 (imported from GitLab)
The Failed to get header. message, the error coming from app/models/tree.rb:5:in 'colorize' and it being fixed by updating Python indicates there is something wrong Python/Pygments.
Please make sure Python and Pygments are setup as described in the installation guide (Python 2.5+ (but not 3!) is a must).
By Administrator on 2012-11-10T09:39:04 (imported from GitLab)
@vsizov The last 3 issues with an exception on the blob.colorize line were fixed by reinstalling/updating python or making sure /usr/bin/env python was >= 2.5 and < 3.0. The next version will contain a check for that.
By Administrator on 2012-12-04T22:24:48 (imported from GitLab)
@Riyad This doesn't solve the problem, but hides it away. Before, I was able to fix my setup by changing few lines in pygments.rb code. The fix was always just something like having line
RubyPython.start(:python_exe => 'python2')
in my ruby pygments gem sources. In the new version this doesn't work like that. I don't know whether it is because of some changes in pygments.rb and/or in gitlab, but I definetly would like to find rational solution for that.
Today I've looked to the pygments.rb upstream and they seem to have everything rewritten again, with absolutely same faulty /usr/bin/env python. I don't understand why anyone would want to do this when /usr/bin/env python2 works on every system just fine (correct me if I'm wrong). On the other hand, it seems like this new variant can be easily fixed for the right python invocation.
By Administrator on 2012-12-04T23:21:45 (imported from GitLab)
If you are maintaining a fork anyways it would seem to be a good solution.
I am unclear why this would not be changed in pygments; if python2 is not present in your distro you can symlink it, whereas if I link python to python2 and packages expect 3...
By Administrator on 2012-12-04T23:52:59 (imported from GitLab)