REQUIRE_GEM_VERSION

Hi all,

I wonder if someone could clarify the purpose of REQUIRE_GEM_VERSION to me?

Whilst it does indeed require the appropriate version of the Rails gem, I took it that it would also require the versions of the various frameworks which were part of that version of Rails - That is, it would require ActiveRecord 1.14.4 for Rails 1.1.6 and not 1.15.1 if Rails 1.2.1 were installed.

Looking at the require_frameworks method in lib/initializer.rb, it's obvious that this isn't the case :

  def require_frameworks
    configuration.frameworks.each { |framework| require(framework.to_s) }
  end

It would seem to me that if you use REQUIRE_GEM_VERSION that is would make sense for Rails to load the versions of the frameworks which comprised that version. Or am I misunderstanding it's purpose?

And also, what is the supported why of binding to earlier releases of the various frameworks - require_gem 'framework, 'x.y.z' in environment.rb?

Regards,
Carl Drinkwater | 29degrees Ltd

29degrees.co.uk - Bespoke Web Application Development.
codegolf.com - Can you craft the smallest code?

Hi all,

I wonder if someone could clarify the purpose of REQUIRE_GEM_VERSION to me?

Whilst it does indeed require the appropriate version of the Rails gem,
I took it that it would also require the versions of the various
frameworks which were part of that version of Rails - That is, it would
require ActiveRecord 1.14.4 for Rails 1.1.6 and not 1.15.1 if Rails
1.2.1 were installed.

That is indeed the intention, and if it doesn't seem to work right,
please open up a ticket at http://dev.rubyonrails.org.

Looking at the require_frameworks method in lib/initializer.rb, it's
obvious that this isn't the case :

  def require_frameworks
    configuration.frameworks.each { |framework| require(framework.to_s) }
  end

I believe that config.frameworks is only used when you have
vendor/rails in place, so it's a bit of a red herring.