diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/boot.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/boot.rb b/railties/lib/rails/generators/rails/app/templates/config/boot.rb index 3165a4091e..44c884623e 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/boot.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/boot.rb @@ -1,15 +1,18 @@ # Package management # Choose one -# Use Bundler (preferred) environment = File.expand_path('../../vendor/gems/environment', __FILE__) -require environment if File.exist?(environment) - -# Use 2.x style vendor/rails directory vendor_rails = File.expand_path('../../vendor/rails', __FILE__) -Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) } if File.exist?(vendor_rails) -# Load Rails from traditional RubyGems -require 'rubygems' +if File.exist?(environment) + # Use Bundler (preferred) + require environment +elsif File.exist?(vendor_rails) + # Use 2.x style vendor/rails directory + Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) } +else + # Load Rails from traditional RubyGems + require 'rubygems' +end require 'rails' |