为 Rails 运行 metric_fu 时出现问题
我试图让这个 metric_fu 开始工作,但我收到了一个奇怪的错误。
braga@braga-laptop:~/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 的单独版本。但我仍然无法运行指标。任何帮助将不胜感激。
我使用的rails版本和ruby版本是
braga@braga-laptop:~/prj/dummy_app$ rails --version
Rails 2.3.14
braga@braga-laptop:~/prj/dummy_app$ ruby --version
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
I am trying to make this metric_fu get to work but I am getting a weird error.
braga@braga-laptop:~/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
In Rakefile line 12 all I have done is given require 'metric_fu'
. I tried uninstalling the chronic gem. Installed separate versions of 0.3.0 and 0.6.2 in all combinations. But still I cannot run the metrics. Any help would be much appreciated.
The rails version and ruby versions I use are
braga@braga-laptop:~/prj/dummy_app$ rails --version
Rails 2.3.14
braga@braga-laptop:~/prj/dummy_app$ ruby --version
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显然,这是一个已知问题。 Metric_fu 非常引人注目,这意味着它对于 Rails 项目来说并不是开箱即用的。 Iain 创建了一个名为 metrical 的优秀 gem,它包装了 metric_fu 并处理所有依赖项。最令人兴奋的功能是,它完全独立于项目运行。
要快速启动并运行,请查看 Ryan 编写的精彩 railscast。
Apparently, this is a known problem. Metric_fu is very obtrusive, meaning it does not run out of the box for a rails project. Iain has created an excellent gem called metrical which wraps metric_fu and takes care of all the dependencies. And the most exciting feature is, it totally runs independent from the project.
To quickly get up and running look at this wonderful railscast by Ryan.
我是 metric_fu 的新维护者,它现在应该可以在 ruby 1.9 上运行,没有任何问题。请参阅 https://github.com/metricfu/metric_fu 中的配置说明,其中包括如何加载 metric_fu外部覆盖输出(例如使用 simplecov)
此外,它现在可以从命令行运行。现在需要捆绑它或运行 rake 或 metrical
I'm the new maintainer of metric_fu and it should work now on ruby 1.9 without any problems. See configuration instructions at https://github.com/metricfu/metric_fu which include how you can have metric_fu load external coverage output (e.g. using simplecov)
Also, it works from the command-line now. Now need to bundle it or run rake or metrical