2012-02-15 142 views
0

我试图用“redmine_git_hosting”从git://github.com/ericpaulbishop/redmine_git_hosting.git为什么红宝石崩溃?

当我试图访问它,我得到一个错误在/var/log/apache2/error.log

/lib/redmine/scm/adapters/git_adapter.rb:26: warning: already initialized constant GIT_BIN 

我可以访问管理平台网站,但这时如果我刷新我得到:

/usr/share/redmine_dev/lib/redmine/scm/adapters/git_adapter.rb:26: warning: already initialized constant GIT_BIN 
[ pid=31351 thr=3075225872 file=ext/apache2/Hooks.cpp:817 time=2012-02-15 15:41:08.102 ]: The backend application (process 3677) did not send a valid HTTP response; instead, it sent nothing at all. It is possible that it has crashed; please check whether there are crashing bugs in this application. 
[ pid=3677 thr=-609445668 file=utils.rb:176 time=2012-02-15 15:41:08.103 ]: *** Exception NameError in application (uninitialized constant Redmine::Scm::Adapters::CommandFailed) (process 3677, thread #<Thread:0xb75931b8>): 

我得到一个500内部错误。

top我可以看到一个Ruby进程被杀死了。

我的环境是:

  • 的Ubuntu 11.10
  • 的PostgreSQL 8.4
  • Apache2.20
  • 的Ruby 1.8.7
  • 管理平台1.3.0
  • 的Phusion版本3.0.11
  • 滑轨(2.3.14)
  • 个RubyGems的1.6.2
+0

你还没有给我们足够的继续工作;我们需要看到源代码。 – 2012-02-15 15:24:02

+0

警告可能是也可能不是问题的一部分 - 这只是一个警告。更大的问题似乎由输出结果表明:'***应用程序中的异常NameError(未初始化的常量Redmine :: Scm :: Adapters :: CommandFailed)(进程3677,线程#<线程:0xb75931b8>):'' – jefflunt 2012-02-15 15:29:56

回答

0

这似乎是相同的错误,因为这一个报告针对Chiliproject叉:https://www.chiliproject.org/issues/828

似乎这只是发生在开发模式中,第一请求之后(从第二请求),因为rails会卸载您的模块,所以您不必每次更改时重新启动应用程序。 在application_controller中,所有scm存储库类都会在每个请求上再次使用require_dependency进行加载。但是这些scm依赖的模块,例如git_adapter和abstract_adapter会被加载到标准的ruby require中,所以它们不会再被加载。 因此,开发中的未初始化的常量错误。

有建议的解决方案是

...请从模块中的要求,并将其集成到application_controller:

require_dependency 'redmine/scm/adapters/abstract_adapter' 
    Redmine::Scm::Base.all.each do |scm| 
     require_dependency "repository/#{scm.underscore}" 
     require_dependency "redmine/scm/adapters/#{scm.underscore}_adapter" 
    end