1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
Nicholas Seckar 2006-04-01 04:58:46 +00:00
parent 3f049b0b6b
commit c10a2d2475
3 changed files with 9 additions and 2 deletions

View file

@ -1,5 +1,7 @@
*SVN* *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 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] * Added gzip compression for JavaScript, CSS, and HTML to default lighttpd.conf [DHH]

View file

@ -13,7 +13,12 @@ if File.directory?("#{RAILS_ROOT}/vendor/rails")
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
else else
require 'rubygems' 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 end
Rails::Initializer.run(:set_load_path) Rails::Initializer.run(:set_load_path)

View file

@ -43,7 +43,7 @@ class AppGenerator < Rails::Generator::Base
m.template "configs/apache.conf", "public/.htaccess" m.template "configs/apache.conf", "public/.htaccess"
# Environments # 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/environment.rb", "config/environment.rb"
m.file "environments/production.rb", "config/environments/production.rb" m.file "environments/production.rb", "config/environments/production.rb"
m.file "environments/development.rb", "config/environments/development.rb" m.file "environments/development.rb", "config/environments/development.rb"