我正在尝试使用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
我可以访问Redmine网站,但如果我刷新,我会得到:
/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进程被杀死了。
我的环境是:
答案 0 :(得分:0)
这似乎与针对Chiliproject分支报告的错误相同:https://www.chiliproject.org/issues/828
似乎这只发生在开发模式中,在第一个请求之后(从第二个请求开始),因为rails卸载了您的模块,因此您不必每次进行更改时都重新启动应用程序。 在application_controller中,每次请求都会使用require_dependency再次加载所有scm存储库类。但是这些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