1 # Don't change this file!
2 # Configure your app in config/environment.rb and config/environments/*.rb
4 RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
9 pick_boot.run unless booted?
13 defined? Rails::Initializer
17 (vendor_rails? ? VendorBoot : GemBoot).new
21 File.exist?("#{RAILS_ROOT}/vendor/rails")
28 Rails::Initializer.run(:set_load_path)
32 class VendorBoot < Boot
34 require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
40 self.class.load_rubygems
46 if version = self.class.gem_version
47 gem 'rails', "=#{version}"
51 rescue Gem::LoadError => load_error
52 $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
58 Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
62 if defined? RAILS_GEM_VERSION
64 elsif ENV.include?('RAILS_GEM_VERSION')
65 ENV['RAILS_GEM_VERSION']
67 parse_gem_version(read_environment_rb)
74 unless rubygems_version >= '0.9.4'
75 $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
80 $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
84 def parse_gem_version(text)
85 $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*'([\d.]+)'/
89 def read_environment_rb
90 File.read("#{RAILS_ROOT}/config/environment.rb")