Fatal Errors with Rails 1.1.2 and Gem vs. Vendor Rails

Hi

Seemingly, there is a path issue when using Rails Engines with Rails
1.1.2. The error appears if you have two different RubyGem version of
Rails installed and want to use vendor rails (1.1.2).

OK, my setup is the following:

  • I have the following Gem Rails versions installed: rails (1.1.2,
    1.0.0)
  • I created a new application with “rails test” and set up the
    database
  • I created the simplest possible database schema (one table “foos”
    with fields “id” and “txt”).
  • I created a model class “Foo”
  • I got the current Rails from Subversion (http://
    dev.rubyonrails.org/svn/rails/branches/stable)
  • I installed the latest Rails Engines version: http://svn.rails-
    engines.org/engines/trunk
  • I configured it to run in “edge mode” and made it perform logging
    as described in the manual.

Then, I tried to run tests and get errors - ugh!

==8<====================================================================

manuel 20:59:48 test $> ruby test/unit/foo_test.rb
Engines 1.1 require_or_load: application_helper
Engines 1.1 require_or_load: application_api
Loaded suite test/unit/foo_test
Started
E
Finished in 0.359273 seconds.

  1. Error:
    test_truth(FooTest):
    NoMethodError: undefined method clear_connection_cache!' for ActiveRecord::Base:Class /Users/manuel/Development/Rails/test/config/../vendor/rails/ activerecord/lib/active_record/base.rb:1129:in method_missing’
    /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/
    active_record/fixtures.rb:511:in `teardown’

1 tests, 1 assertions, 0 failures, 1 errors

==8<====================================================================

It seems that Engines somehow makes the active_support code load
active_record’s fixtures.rb from the Gems.

Of course, it is possible to remove the Rails 1.0 gems but I thought
you would like to know that there seems to be something fishy inside
the Engines path code.

Regards,

Manuel