2012-02-15 146 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