Permalink
Browse files

Teach Rails apps to only load gems of the same Rails version they wer…

…e generated with.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4109 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 3f049b0 commit c10a2d247576bff6be6500432e3cf8eb38cc2afd @seckar seckar committed Apr 1, 2006
View
@@ -1,5 +1,7 @@
*SVN*
+* Teach Rails apps to only load gems of the same Rails version they were generated with. [Nicholas Seckar]
+
* Added expiration settings for JavaScript, CSS, HTML, and images to default lighttpd.conf [DHH]
* Added gzip compression for JavaScript, CSS, and HTML to default lighttpd.conf [DHH]
@@ -13,7 +13,12 @@
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)
@@ -43,7 +43,7 @@ def manifest
m.template "configs/apache.conf", "public/.htaccess"
# Environments
- m.file "environments/boot.rb", "config/boot.rb"
+ m.template "environments/boot.rb", "config/boot.rb"
m.file "environments/environment.rb", "config/environment.rb"
m.file "environments/production.rb", "config/environments/production.rb"
m.file "environments/development.rb", "config/environments/development.rb"

0 comments on commit c10a2d2

Please sign in to comment.