2011-08-23 88 views
1

我想讓這個metric_fu工作,但我得到一個奇怪的錯誤。Rails運行metric_fu的問題

[email protected]:~/prj/dummy_app$ rake metrics:all --trace 
(in /home/braga/prj/dummy_app) 
rake aborted! 
RubyGem version error: chronic(0.6.2 not ~> 0.3.0) 
/usr/local/lib/site_ruby/1.8/rubygems.rb:812:in `report_activate_error' 
/usr/local/lib/site_ruby/1.8/rubygems.rb:223:in `activate' 
/usr/local/lib/site_ruby/1.8/rubygems.rb:258:in `activate' 
/usr/local/lib/site_ruby/1.8/rubygems.rb:257:in `each' 
/usr/local/lib/site_ruby/1.8/rubygems.rb:257:in `activate' 
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:33:in `require' 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in' 
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
/home/braga/prj/dummy_app/Rakefile:12 
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load' 
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile' 
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile' 
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' 
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile' 
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run' 
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' 
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' 
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 
/usr/bin/rake:19:in `load' 
/usr/bin/rake:19 

在Rakefile行12中,我所做的全部都是require 'metric_fu'。我試着卸載慢性寶石。在所有組合中安裝0.3.0和0.6.2的單獨版本。但是我仍然無法運行這些指標。任何幫助將非常感激。我用

軌道版本和紅寶石版本

[email protected]:~/prj/dummy_app$ rails --version 
Rails 2.3.14 
[email protected]:~/prj/dummy_app$ ruby --version 
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux] 
+0

是的..我用--trace但是沒有透露太多 – bragboy

回答

2

顯然,這是一個已知的問題。 Metric_fu非常突兀,這意味着它不會用於鐵路項目。 Iain創建了一個稱爲度量的優秀寶石,它包裝了metric_fu並處理所有的依賴關係。最令人興奮的特點是,它完全獨立於該項目運行。

要快速啓動並運行看Ryan的這個美妙的railscast

0

我是metric_fu的新維護者,現在應該可以在ruby 1.9上工作了,沒有任何問題。請參閱https://github.com/metricfu/metric_fu上的配置說明,其中包括如何使metric_fu加載外部覆蓋率輸出(例如,使用simplecov)

此外,它現在可以從命令行運行。現在需要捆綁它或運行耙子或度量