Already initialized constant in Rails 2.3.4

In Rails 2.3.4 I have the following error on my production machine, ruby 1.8.7
(2008-08-11 patchlevel 72) [i486-linux], but not on my development machine,
ruby 1.8.6 (2009-06-08 patchlevel 369) [i586-linux]. There are other
differences (Debian 5.0 vs. OpenSuSE 10.3). Any suggestions on whether to
ignore the warning or how to fix the problem?

# script/console
Loading development environment (Rails 2.3.4)
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:42: warning: already initialized constant HasManyThroughCantAssociateThroughHasManyReflection


I'm having the same problem..

I worked around the problem by applying the patches to 2.3.3.


Quoting chris.drappier <>:

Links to patches here:

Quoting Jeffrey L. Taylor <>:

wasn't the patches to 2.3.3 applied via 2.3.4 ??

Yes, and apparently other changes. Applying the patches to 2.3.3 works for
me. 2.3.4 throws the warning in the original post. All my automated tests
pass, but I am still nervous about running w/ a warning I don't understand.
Hence the test of a patched 2.3.3. Works for me.


Quoting st23am <>:

I'm seeing the same warning, also with Ruby 1.8.7 .

Did anyone solve this problem? If so, how?


By applying the security patches to 2.3.3. URLs below.


Quoting rhbarrett <>:

Did anyone solve this problem? If so, how?