diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2006-04-01 04:58:46 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2006-04-01 04:58:46 +0000 |
commit | c10a2d247576bff6be6500432e3cf8eb38cc2afd (patch) | |
tree | bcaafd650f0a06d8e75ac0610083e7a1f3d75e8f /railties/environments | |
parent | 3f049b0b6b5a338786c3dfafb31edf937f4ecb13 (diff) | |
download | rails-c10a2d247576bff6be6500432e3cf8eb38cc2afd.tar.gz rails-c10a2d247576bff6be6500432e3cf8eb38cc2afd.tar.bz2 rails-c10a2d247576bff6be6500432e3cf8eb38cc2afd.zip |
Teach Rails apps to only load gems of the same Rails version they were generated with.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4109 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/environments')
-rw-r--r-- | railties/environments/boot.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/railties/environments/boot.rb b/railties/environments/boot.rb index 9fcd50fe3f..a57f0f46da 100644 --- a/railties/environments/boot.rb +++ b/railties/environments/boot.rb @@ -13,7 +13,12 @@ if File.directory?("#{RAILS_ROOT}/vendor/rails") require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" else require 'rubygems' - require 'initializer' + required_version = '<%= Rails::VERSION::STRING %>' + rails_gem = Gem.cache.search('rails', "=#{required_version}").first + unless rails_gem + STDERR.puts "Cannot find gem for Rails =#{required_version}. Install missing gem or change config/boot.rb." + end + require rails_gem.full_gem_path + '/lib/initializer' end Rails::Initializer.run(:set_load_path) |