Michael Schoen
2005-Sep-29 14:50 UTC
[Rails-core] rubygems issue w/ new boot/initializer approach
I''m not completely clear on why it''s happening, but the new boot/initializer approach to setting up the Rails environment doesn''t completely work correctly with Rails installed as gems (using the beta gems). The intent is that initializer.rb is responsible for actually loading the framework, optionally NOT loading some portions that may not be used. And the setting of constants, namely RAILS_CONNECTION_ADAPTERS, assumes that the framework hasn''t been loaded yet. Well, this works just dandy when running on edge rails via the vendor/rails dir -- because boot just directly requires initializer.rb. But when running through rubygems, when initializer.rb is required, it actually loads the entire framework BEFORE requiring initializer.rb (traced this through w/ a bunch of hacked puts statements). The ''require'' definition of rubygems goes ahead and activates all the dependent gems as well. Anyway, the impact is that a few things don''t work right as a result: - any attempt to not load portions of the framework fail (silently) - trying to use config.connection_adapters fails (w/ a warning), because AR has already been inadvertently loaded by gems, already setting the constant I don''t know rubygems enough to suggest if there''s a way to work around this.