Forum: Rails Engines development Fatal Errors with Rails 1.1.2 and Gem vs. Vendor Rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
54532f023496410e0d7b1add5561ba45?d=identicon&s=25 Manuel Holtgrewe (Guest)
on 2006-04-11 21:05
(Received via mailing list)
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
This topic is locked and can not be replied to.