source: subversion/sites/rails_port/config/boot.rb @ 2489

Last change on this file since 2489 was 1203, checked in by steve, 13 years ago

add config, rm logs (why does rails do this!?)

File size: 1.4 KB
Line 
1# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
2
3unless defined?(RAILS_ROOT)
4  root_path = File.join(File.dirname(__FILE__), '..')
5
6  unless RUBY_PLATFORM =~ /mswin32/
7    require 'pathname'
8    root_path = Pathname.new(root_path).cleanpath(true).to_s
9  end
10
11  RAILS_ROOT = root_path
12end
13
14unless defined?(Rails::Initializer)
15  if File.directory?("#{RAILS_ROOT}/vendor/rails")
16    require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
17  else
18    require 'rubygems'
19
20    environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
21    environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
22    rails_gem_version = $1
23
24    if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
25      rails_gem = Gem.cache.search('rails', "=#{version}").first
26
27      if rails_gem
28        require_gem "rails", "=#{version}"
29        require rails_gem.full_gem_path + '/lib/initializer'
30      else
31        STDERR.puts %(Cannot find gem for Rails =#{version}:
32    Install the missing gem with 'gem install -v=#{version} rails', or
33    change environment.rb to define RAILS_GEM_VERSION with your desired version.
34  )
35        exit 1
36      end
37    else
38      require_gem "rails"
39      require 'initializer'
40    end
41  end
42
43  Rails::Initializer.run(:set_load_path)
44end
Note: See TracBrowser for help on using the repository browser.