0
-# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
0
+# Don't change this file!
0
+# Configure your app in config/environment.rb and config/environments/*.rb
0
-unless defined?(RAILS_ROOT)
0
- root_path = File.join(File.dirname(__FILE__), '..')
0
+RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
0
- unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
0
- root_path = Pathname.new(root_path).cleanpath(true).to_s
0
- RAILS_ROOT = root_path
0
+ defined? Rails::Initializer
0
+ (vendor_rails? ? VendorBoot : GemBoot).new
0
+ File.exist?("#{RAILS_ROOT}/vendor/rails")
0
-unless defined?(Rails::Initializer)
0
- if File.directory?("#{RAILS_ROOT}/vendor/rails")
0
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
0
+ load(preinitializer_path) if File.exist?(preinitializer_path)
0
- environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
0
- environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
0
- rails_gem_version = $1
0
+ def preinitializer_path
0
+ "#{RAILS_ROOT}/config/preinitializer.rb"
0
- if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
0
- # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
0
- rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
0
+ Rails::Initializer.run(:set_load_path)
0
- gem "rails", "=#{rails_gem.version.version}"
0
- require rails_gem.full_gem_path + '/lib/initializer'
0
+ class VendorBoot < Boot
0
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
0
+ Rails::Initializer.run(:install_gem_spec_stubs)
0
+ self.class.load_rubygems
0
+ if version = self.class.gem_version
0
- STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
0
- Install the missing gem with 'gem install -v=#{version} rails', or
0
- change environment.rb to define RAILS_GEM_VERSION with your desired version.
0
+ rescue Gem::LoadError => load_error
0
+ $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.)
0
+ Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
0
+ if defined? RAILS_GEM_VERSION
0
+ elsif ENV.include?('RAILS_GEM_VERSION')
0
+ ENV['RAILS_GEM_VERSION']
0
+ parse_gem_version(read_environment_rb)
0
+ unless rubygems_version >= '0.9.4'
0
+ $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
0
+ $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
0
+ def parse_gem_version(text)
0
+ $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
0
+ def read_environment_rb
0
+ File.read("#{RAILS_ROOT}/config/environment.rb")
0
- Rails::Initializer.run(:set_load_path)
Comments
Strange – github not showing anything for this commit.
snowblink, Strange. It looks like there’s a GitHub ticket about this issue:
http://logicalawesome.lighthouseapp.com/projects/8570-github/tickets/636-detail-for-most-recent-commit-is-empty#ticket-636-2