warning: already initialized constant

Hi All,

The Linux box I was using to do my rails development had the hard disk upgraded and restarted. Now I am getting the following warnings when I use script/console or script/server

Loading development environment (Rails 2.1.0) /denorm_brag_report.rb:423: warning: already initialized constant MAIN_CATEGORIES denorm_brag_report.rb:425: warning: already initialized constant SUB_CATEGORIES /denorm_brag_report.rb:432: warning: already initialized constant TABLE_STD_DESCRIPTIONS /denorm_brag_report.rb:447: warning: already initialized constant SUMMARY_NAMES /denorm_brag_report.rb:455: warning: already initialized constant REPORT_TYPES /denorm_brag_report.rb:469: warning: already initialized constant BRAG_SUMMARY_COLS

I have checked the code and these constants are only used in one place

I have cleared the cache, checked the gems, and anything else I can think of

Is there anything else I could check

Gurdipe

Does your code include the denorm_brag_report.rb file more than once?

hi Michael

I have checked and its not been called anywhere else, but may be im missing something simple

it always gives a warning on the last entry of the set of values in assigned to the constants

gurdipe

I would recommend putting a breakpoint on the line that defines the constant, and then the second time it gets there have a look at the call stack to see how it's ending up there twice.

It might be that this file is somewhere in autoload path (/lib, etc.) and you’re also manually requiring it by hand somewhere.