python - 在 Mountain Lion 服务器上查看文件源时出现 Gitlab 500 错误

标签 python osx-mountain-lion gitlab

还有另一个问题。

如果我尝试在"file"选项卡中查看文件的内容,则什么也没有显示。

快速查看 production.log 后,我发现了以下内容:

Completed 500 Internal Server Error in 149ms

ActionView::Template::Error (Failed to get header.):
    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/models/tree.rb:6:in `colorize'
  app/views/tree/blob/_text.html.haml:12:in `_app_views_tree_blob__text_html_haml__2117416289591340656_70112288282740'
  app/views/tree/_blob.html.haml:9:in `_app_views_tree__blob_html_haml__810415587318185235_70112333949220'
  app/views/tree/_tree.html.haml:19:in `_app_views_tree__tree_html_haml___380187574798250597_70112300103920'
  app/views/tree/show.js.haml:3:in `_app_views_tree_show_js_haml__4018035125126620215_70112300060420'

谷歌搜索后,我发现了一些 Github 问题,将其描述为 python 版本错误。

我通过 brew install python 安装了 python,它应该是正确安装的 python。至少我从控制台获得了正确的版本。

Python 2.7.3 (default, Feb 11 2013, 16:34:20) 
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.24)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

我刚刚仔细检查了 bundle exec rake gitlab:check RAILS_ENV=production

我认为一切都很好,期待一些与 OS X 相关的东西,比如初始化脚本。

Checking Environment ...

gitlab user is in gitg group? ... yes
Has no "-e" in ~gitolite/.profile ... yes
Git configured for gitlab user? ... yes
Has python2? ... yes
python2 is supported version? ... yes

Checking Environment ... Finished

Checking Gitolite ...

Using recommended version ... no
  Try fixing it:
  We strongly recommend using the version pointed out in the installation guide.
  For more information see:
  doc/install/installation.md in section "Gitolite"
Repo umask is 0007 in .gitolite.rc? ... yes
Allow all Git config keys in .gitolite.rc ... yes
Config directory exists? ... yes
Config directory owned by gitolite:gitg ... yes
Config directory access is drwxr-x---? ... yes
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by gitolite:gitg? ... yes
Repo base access is drwxrws---? ... yes
Can clone gitolite-admin? ... yes
Can commit to gitolite-admin? ... yes
post-receive hook exists? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ... 
Some-Customer / Some Repo ... ok
Some-Customer / Some Repo ... ok
Some-Customer / Some Repo ... ok
Git config in repos: ... 
Some-Customer / Some Repo ... ok
Some-Customer / Some Repo ... ok
Some-Customer / Some Repo ... ok

Checking Gitolite ... Finished

Checking Sidekiq ...

Running? ... yes

Checking Sidekiq ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... no
  Try fixing it:
  Install the init script
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  Please fix the error above and rerun the checks.
Init script up-to-date? ... can't check because of previous errors
Projects have satellites? ... 
Some-Customer / Some Repo ... yes
Some-Customer / Some Repo ... yes
Some-Customer / Some Repo ... yes

Checking GitLab ... Finished

最佳答案

这可能不仅仅是一个 python 版本,如“Issue 2214 ”或“Issue 2272 ”。

最近的错误,例如 Issue 2817仍未解决。

如“Issue 2410”中所述,仔细检查检查:

sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production

关于python - 在 Mountain Lion 服务器上查看文件源时出现 Gitlab 500 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14816286/

相关文章:

git: 'credential-wincred' 不是 git 命令。见 'git --help' 。在 Mac 上

python - 拓展新式类

osx-mountain-lion - 冲泡医生 : Warning: Unbrewed dylibs were found in/usr/local/lib

macos - 在使用 Applescript 单击之前验证复选框

haskell - 在 OS X 上运行 Haskell 程序时不允许进行操作

docker - 如何使用 secret 中的 ssh key 将私有(private) git 存储库克隆到 kubernetes pod 中?

在 CentOS 上更新到 OpenSSh 5.3 后的 Git 访问问题

python - 通过查询集进行链式查找

python - 将 POST 请求重定向到已使用的 URL (Django)

python - 使用 .loc 选择多索引级别的重复值