X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7fc2dbecd572718421d000441ccb305241e7d5ff..9fa6930ba2ba8caa4bf1284ae740ad2931f0d9d0:/config/boot.rb diff --git a/config/boot.rb b/config/boot.rb index b71c198db..0a516880c 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -25,7 +25,7 @@ module Rails end def preinitialize - load(preinitializer_path) if File.exists?(preinitializer_path) + load(preinitializer_path) if File.exist?(preinitializer_path) end def preinitializer_path @@ -43,6 +43,7 @@ module Rails class VendorBoot < Boot def load_initializer require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" + Rails::Initializer.run(:install_gem_spec_stubs) end end @@ -66,7 +67,7 @@ module Rails class << self def rubygems_version - Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion + Gem::RubyGemsVersion rescue nil end def gem_version @@ -81,19 +82,19 @@ module Rails def load_rubygems require 'rubygems' - - unless rubygems_version >= '0.9.4' - $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.) + min_version = '1.3.1' + unless rubygems_version >= min_version + $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.) exit 1 end rescue LoadError - $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org) + $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org) exit 1 end def parse_gem_version(text) - $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*'([!~<>=]*\s*[\d.]+)'/ + $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/ end private