metrical/metric_fu gives the error: uninitialized constant MetricFu::Configuration - how do I require this properly?

51 views
Skip to first unread message

NullVoxPopuli

unread,
Jan 7, 2013, 5:23:36 PM1/7/13
to metr...@googlegroups.com

Originally, I was following this guide: http://metric-fu.rubyforge.org/ But that didn't work (got the same error as I'm getting now). and I read that using metrical is supposedly easier, as it is supposed to do a lot of the set up for you. But the following happens:

From the Terminal,

 $ bundle exec rake spec
rake aborted!
uninitialized constant MetricFu::Configuration

in my Gemfile I have:

gem "metrical", :require => false

and then in my rakefile I have:

require "metrical"


rails 2.3.14
ruby 1.8.7
metrical 0.1.0

how can I require metrical / metric fu correctly?

Benjamin Fleischer

unread,
Jan 7, 2013, 5:54:11 PM1/7/13
to metr...@googlegroups.com
Hi NullVoxPopuli-

Which version of metric_fu are you using? If not using the latest, could you please create an issue on https://github.com/metricfu/metric_fu/issues  and continue this conversation there?

I suspect you are using a version I released that had a bug in it.  Try updating your metric_fu gem to the latest version.  Also note, for what it's worth, if you're not doing any special configurations, you may be able to gem install metric_fu and just run 'metric_fu' from your application root.  You may also want to use the metric_fu-metrical gem, which has the metric_fu-metrical command

I also would like to apologize that the guide is out of date in some parts.  I'll be getting to that at some point.

-Benjamin
p.s. I am currently at work splitting the gem into a legacy metric_fu18 and a metric_fu that supports 1.9 now with limited 1.8 support.  I have recently discovered that while ruby code in a gem can do all sorts of things to support different ruby versions, a packaged gem cannot have different dependencies depending on the ruby version.  Hence, some recent releases that I thought were requiring different libraries for ruby 1.8 vs. 1.9, were not doing so. The only way for a rubygems project to have two distinct dependency trees without any user intervention is to have two gems.  Otherwise, I could only suggest that a user install certain gem versions on load errors.
Reply all
Reply to author
Forward
0 new messages