0
votes

Have a legacy application built on Rails 3.2.16, Ruby 1.9.3 which is being assessed for updates. Apart from the obvious in that it's running on outdated versions of both Ruby and Rails, I'm stuck with an error when trying to gather the stats.

When executing the command:

rake stats

I'm getting the error:

rake stats
rake aborted!
cannot load such file -- code_statistics

This is also correlated via the 'Rails Console' whereby issuing the command require 'code_statistics' also produces a similar error.

Now I can confirm the following

  • Rake task exists as shown by the rake -T giving command output of rake stats # Report code statistics (KLOCs, etc...
  • CodeStatistics class is in the railities library

I suspect that it's a path or file issue with potentially an environment setting that I'm missing Rails 3.2.

Any suggestions ?

Regards Grant

1

1 Answers

1
votes

Ok - so solved the problem. It was a path issue as first suspected.

After some digging in this legacy system I'm reviewing there were path changes made in rspec.rake and cuke.rake files which indicated a parent directory. Changing the path

from:

require 'code_statistics'

to

require 'rails/code_statistics'

has now resolved the issue such that rake stats gives the usual results.